Skip to content

Commit 0273ed2

Browse files
committed
pkg/controller: Update the CRD testEnv field to use the CRD type
Update the CRD field to use the apiextensionsv1.CustomResourceDefinition type instead of the client.Object interface. It looks like this change was introduced during the sweep to k8s 1.22 bump: kubernetes-sigs/controller-runtime@b5eeb71 Signed-off-by: timflannagan <[email protected]>
1 parent db83547 commit 0273ed2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

pkg/controller/operators/openshift/suite_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
. "github.com/onsi/gomega"
1111
configv1 "github.com/openshift/api/config/v1"
1212
"github.com/operator-framework/api/crds"
13+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415
"k8s.io/client-go/rest"
1516
ctrl "sigs.k8s.io/controller-runtime"
@@ -54,8 +55,8 @@ var _ = BeforeSuite(func() {
5455
base := filepath.Join("..", "..", "..", "..", "vendor", "github.com", "openshift", "api", "config", "v1")
5556
testEnv = &envtest.Environment{
5657
ErrorIfCRDPathMissing: true,
57-
CRDs: []client.Object{
58-
crds.ClusterServiceVersion(),
58+
CRDs: []apiextensionsv1.CustomResourceDefinition{
59+
*crds.ClusterServiceVersion(),
5960
},
6061
CRDDirectoryPaths: []string{
6162
filepath.Join(base, "0000_00_cluster-version-operator_01_clusteroperator.crd.yaml"),

pkg/controller/operators/suite_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ var _ = BeforeSuite(func() {
8888
useExisting := false
8989
testEnv = &envtest.Environment{
9090
UseExistingCluster: &useExisting,
91-
CRDs: []client.Object{
92-
crds.CatalogSource(),
93-
crds.ClusterServiceVersion(),
94-
crds.InstallPlan(),
95-
crds.Subscription(),
96-
crds.OperatorGroup(),
97-
crds.Operator(),
98-
crds.OperatorCondition(),
91+
CRDs: []apiextensionsv1.CustomResourceDefinition{
92+
*crds.CatalogSource(),
93+
*crds.ClusterServiceVersion(),
94+
*crds.InstallPlan(),
95+
*crds.Subscription(),
96+
*crds.OperatorGroup(),
97+
*crds.Operator(),
98+
*crds.OperatorCondition(),
9999
},
100100
}
101101

0 commit comments

Comments
 (0)