Skip to content

Commit b7febc1

Browse files
committed
Fixes to CRD v1 compatibility in tests.
Signed-off-by: Ben Luddy <[email protected]>
1 parent 455e603 commit b7febc1

22 files changed

+200
-102
lines changed

test/e2e/crd_e2e_test.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var _ = Describe("CRD Versions", func() {
3737
Name: crdName,
3838
},
3939
Spec: apiextensionsv1.CustomResourceDefinitionSpec{
40+
Scope: apiextensionsv1.NamespaceScoped,
4041
Group: "cluster.com",
4142
Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
4243
{
@@ -141,7 +142,7 @@ var _ = Describe("CRD Versions", func() {
141142
Kind: crdPlural,
142143
ListKind: "list" + crdPlural,
143144
},
144-
Scope: "Namespaced",
145+
Scope: apiextensions.NamespaceScoped,
145146
},
146147
}
147148

@@ -183,6 +184,7 @@ var _ = Describe("CRD Versions", func() {
183184
Kind: crdPlural,
184185
ListKind: "list" + crdPlural,
185186
},
187+
Scope: apiextensions.NamespaceScoped,
186188
},
187189
}
188190

@@ -307,7 +309,7 @@ var _ = Describe("CRD Versions", func() {
307309
Kind: crdPlural,
308310
ListKind: "list" + crdPlural,
309311
},
310-
Scope: "Namespaced",
312+
Scope: apiextensionsv1.NamespaceScoped,
311313
},
312314
}
313315
_, err := c.ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Create(context.TODO(), oldCRD, metav1.CreateOptions{})
@@ -321,13 +323,18 @@ var _ = Describe("CRD Versions", func() {
321323
}
322324
GinkgoT().Logf("old crd status stored versions: %#v", oldCRD.Status.StoredVersions)
323325

324-
// set v1alpha1 to no longer served
326+
// set v1alpha1 to no longer stored
325327
oldCRD.Spec.Versions[0].Storage = false
326328
// update CRD on-cluster with a new version
327329
oldCRD.Spec.Versions = append(oldCRD.Spec.Versions, apiextensionsv1.CustomResourceDefinitionVersion{
328330
Name: "v1alpha2",
329331
Served: true,
330332
Storage: true,
333+
Schema: &apiextensionsv1.CustomResourceValidation{
334+
OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
335+
Type: "object",
336+
},
337+
},
331338
})
332339

333340
updatedCRD, err := c.ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Update(context.TODO(), oldCRD, metav1.UpdateOptions{})
@@ -364,7 +371,7 @@ var _ = Describe("CRD Versions", func() {
364371
Kind: crdPlural,
365372
ListKind: "list" + crdPlural,
366373
},
367-
Scope: "Namespaced",
374+
Scope: apiextensions.NamespaceScoped,
368375
},
369376
}
370377

test/e2e/csv_e2e_test.go

+11-12
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ var _ = Describe("ClusterServiceVersion", func() {
899899
Kind: crdPlural,
900900
ListKind: "list" + crdPlural,
901901
},
902-
Scope: "Namespaced",
902+
Scope: apiextensions.NamespaceScoped,
903903
},
904904
})
905905
Expect(err).ShouldNot(HaveOccurred())
@@ -1238,7 +1238,7 @@ var _ = Describe("ClusterServiceVersion", func() {
12381238
Kind: crdPlural,
12391239
ListKind: "list" + crdPlural,
12401240
},
1241-
Scope: "Namespaced",
1241+
Scope: apiextensions.NamespaceScoped,
12421242
},
12431243
}
12441244
crd.SetOwnerReferences([]metav1.OwnerReference{{
@@ -2381,8 +2381,7 @@ var _ = Describe("ClusterServiceVersion", func() {
23812381
Kind: crdPlural,
23822382
ListKind: "list" + crdPlural,
23832383
},
2384-
2385-
Scope: "Namespaced",
2384+
Scope: apiextensions.NamespaceScoped,
23862385
},
23872386
})
23882387

@@ -2574,7 +2573,7 @@ var _ = Describe("ClusterServiceVersion", func() {
25742573
Kind: crdPlural,
25752574
ListKind: "list" + crdPlural,
25762575
},
2577-
Scope: "Namespaced",
2576+
Scope: apiextensions.NamespaceScoped,
25782577
},
25792578
})
25802579
Expect(err).ShouldNot(HaveOccurred())
@@ -2764,7 +2763,7 @@ var _ = Describe("ClusterServiceVersion", func() {
27642763
Kind: crdPlural,
27652764
ListKind: "list" + crdPlural,
27662765
},
2767-
Scope: "Namespaced",
2766+
Scope: apiextensions.NamespaceScoped,
27682767
},
27692768
})
27702769
Expect(err).ShouldNot(HaveOccurred())
@@ -2954,7 +2953,7 @@ var _ = Describe("ClusterServiceVersion", func() {
29542953
Kind: crdPlural,
29552954
ListKind: "list" + crdPlural,
29562955
},
2957-
Scope: "Namespaced",
2956+
Scope: apiextensions.NamespaceScoped,
29582957
},
29592958
})
29602959

@@ -3125,7 +3124,7 @@ var _ = Describe("ClusterServiceVersion", func() {
31253124
Kind: crdPlural,
31263125
ListKind: "list" + crdPlural,
31273126
},
3128-
Scope: "Namespaced",
3127+
Scope: apiextensions.NamespaceScoped,
31293128
},
31303129
})
31313130
Expect(err).ShouldNot(HaveOccurred())
@@ -3403,7 +3402,7 @@ var _ = Describe("ClusterServiceVersion", func() {
34033402
Kind: crdPlural,
34043403
ListKind: "list" + crdPlural,
34053404
},
3406-
Scope: "Namespaced",
3405+
Scope: apiextensions.NamespaceScoped,
34073406
},
34083407
})
34093408
Expect(err).ShouldNot(HaveOccurred())
@@ -3567,7 +3566,7 @@ var _ = Describe("ClusterServiceVersion", func() {
35673566
Kind: crdPlural,
35683567
ListKind: "list" + crdPlural,
35693568
},
3570-
Scope: "Namespaced",
3569+
Scope: apiextensions.NamespaceScoped,
35713570
},
35723571
})
35733572
defer cleanupCRD()
@@ -3797,7 +3796,7 @@ var _ = Describe("ClusterServiceVersion", func() {
37973796
Kind: crdPlural,
37983797
ListKind: "list" + crdPlural,
37993798
},
3800-
Scope: "Namespaced",
3799+
Scope: apiextensions.NamespaceScoped,
38013800
},
38023801
})
38033802
Expect(err).ShouldNot(HaveOccurred())
@@ -4346,7 +4345,7 @@ func newMockExtServerDeployment(labelName string, mGVKs []mockGroupVersionKind)
43464345
for _, mGVK := range mGVKs {
43474346
containers = append(containers, corev1.Container{
43484347
Name: genName(mGVK.Name),
4349-
Image: "quay.io/coreos/mock-extension-apiserver:master",
4348+
Image: "quay.io/operator-framework/mock-extension-apiserver:master",
43504349
Command: []string{"/bin/mock-extension-apiserver"},
43514350
Args: []string{
43524351
"-v=4",

test/e2e/data/catalog.new.yaml

+16-4
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,38 @@ metadata:
66
namespace: tectonic-system
77
data:
88
customResourceDefinitions: |-
9-
- apiVersion: apiextensions.k8s.io/v1beta1
9+
- apiVersion: apiextensions.k8s.io/v1
1010
kind: CustomResourceDefinition
1111
metadata:
1212
name: testcs.example.com
1313
spec:
1414
group: example.com
15-
version: v1alpha1
15+
versions:
16+
- name: v1alpha1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object
1622
scope: Namespaced
1723
names:
1824
plural: testcs
1925
singular: testc
2026
kind: TestC
2127
listKind: TestCList
22-
- apiVersion: apiextensions.k8s.io/v1beta1
28+
- apiVersion: apiextensions.k8s.io/v1
2329
kind: CustomResourceDefinition
2430
metadata:
2531
name: testbs.example.com
2632
spec:
2733
group: example.com
28-
version: v1alpha1
34+
versions:
35+
- name: v1alpha1
36+
served: true
37+
storage: true
38+
schema:
39+
openAPIV3Schema:
40+
type: object
2941
scope: Namespaced
3042
names:
3143
plural: testbs

test/e2e/data/catalog.old.yaml

+16-4
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,38 @@ metadata:
66
namespace: tectonic-system
77
data:
88
customResourceDefinitions: |-
9-
- apiVersion: apiextensions.k8s.io/v1beta1
9+
- apiVersion: apiextensions.k8s.io/v1
1010
kind: CustomResourceDefinition
1111
metadata:
1212
name: testas.example.com
1313
spec:
1414
group: example.com
15-
version: v1alpha1
15+
versions:
16+
- name: v1alpha1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object
1622
scope: Namespaced
1723
names:
1824
plural: testas
1925
singular: testa
2026
kind: TestA
2127
listKind: TestAList
22-
- apiVersion: apiextensions.k8s.io/v1beta1
28+
- apiVersion: apiextensions.k8s.io/v1
2329
kind: CustomResourceDefinition
2430
metadata:
2531
name: testbs.example.com
2632
spec:
2733
group: example.com
28-
version: v1alpha1
34+
versions:
35+
- name: v1alpha1
36+
served: true
37+
storage: true
38+
schema:
39+
openAPIV3Schema:
40+
type: object
2941
scope: Namespaced
3042
names:
3143
plural: testbs

test/e2e/data/kiali-image-bundle/manifests/kiali.crd.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: kialis.kiali.io
@@ -12,10 +12,12 @@ spec:
1212
plural: kialis
1313
singular: kiali
1414
scope: Namespaced
15-
subresources:
16-
status: {}
17-
version: v1alpha1
1815
versions:
1916
- name: v1alpha1
2017
served: true
2118
storage: true
19+
subresources:
20+
status: {}
21+
schema:
22+
openAPIV3Schema:
23+
type: object

test/e2e/data/kiali-image-bundle/manifests/kiali.monitoringdashboards.crd.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: monitoringdashboards.monitoring.kiali.io
@@ -12,4 +12,10 @@ spec:
1212
plural: monitoringdashboards
1313
singular: monitoringdashboard
1414
scope: Namespaced
15-
version: v1alpha1
15+
versions:
16+
- name: v1alpha1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object

test/e2e/data/kiali-manifests/0.18.1/kiali.crd.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: kialis.kiali.io
@@ -12,10 +12,12 @@ spec:
1212
plural: kialis
1313
singular: kiali
1414
scope: Namespaced
15-
subresources:
16-
status: {}
17-
version: v1alpha1
1815
versions:
1916
- name: v1alpha1
2017
served: true
2118
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object
22+
subresources:
23+
status: {}

test/e2e/data/kiali-manifests/1.1.0/kiali.crd.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: kialis.kiali.io
@@ -12,10 +12,12 @@ spec:
1212
plural: kialis
1313
singular: kiali
1414
scope: Namespaced
15-
subresources:
16-
status: {}
17-
version: v1alpha1
1815
versions:
1916
- name: v1alpha1
2017
served: true
2118
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object
22+
subresources:
23+
status: {}

test/e2e/data/kiali-manifests/1.1.0/kiali.monitoringdashboards.crd.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: monitoringdashboards.monitoring.kiali.io
@@ -12,4 +12,10 @@ spec:
1212
plural: monitoringdashboards
1313
singular: monitoringdashboard
1414
scope: Namespaced
15-
version: v1alpha1
15+
versions:
16+
- name: v1alpha1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object

test/e2e/data/kiali-manifests/1.3.1/kiali.crd.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: kialis.kiali.io
@@ -12,10 +12,12 @@ spec:
1212
plural: kialis
1313
singular: kiali
1414
scope: Namespaced
15-
subresources:
16-
status: {}
17-
version: v1alpha1
1815
versions:
1916
- name: v1alpha1
2017
served: true
2118
storage: true
19+
subresources:
20+
status: {}
21+
schema:
22+
openAPIV3Schema:
23+
type: object

test/e2e/data/kiali-manifests/1.3.1/kiali.monitoringdashboards.crd.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apiextensions.k8s.io/v1beta1
1+
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: monitoringdashboards.monitoring.kiali.io
@@ -12,4 +12,10 @@ spec:
1212
plural: monitoringdashboards
1313
singular: monitoringdashboard
1414
scope: Namespaced
15-
version: v1alpha1
15+
versions:
16+
- name: v1alpha1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object

0 commit comments

Comments
 (0)