Skip to content

Commit 455e603

Browse files
exdxbenluddy
authored andcommitted
fix: update e2e test CRDs to use v1 structural schemas
Signed-off-by: Daniel Sover <[email protected]>
1 parent 1956627 commit 455e603

6 files changed

+411
-105
lines changed

test/e2e/bundle_e2e_test.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
)
2424

2525
//go:embed testdata/vpa/crd.yaml
26-
var vpaCRDraw []byte
26+
var vpaCRDRaw []byte
2727

2828
var _ = Describe("Installing bundles with new object types", func() {
2929
var (
@@ -42,7 +42,6 @@ var _ = Describe("Installing bundles with new object types", func() {
4242
TearDown(testNamespace)
4343
})
4444

45-
// TODO bump vpa CRD to v1, otherwise this test will now fail
4645
When("a bundle with a pdb, priorityclass, and VPA object is installed", func() {
4746
const (
4847
packageName = "busybox"
@@ -59,8 +58,8 @@ var _ = Describe("Installing bundles with new object types", func() {
5958
)
6059

6160
// create VPA CRD on cluster
62-
Expect(vpaCRDraw).ToNot(BeEmpty(), "could not read vpa bindata")
63-
data, err := yaml.YAMLToJSON(vpaCRDraw)
61+
Expect(vpaCRDRaw).ToNot(BeEmpty(), "could not read vpa bindata")
62+
data, err := yaml.YAMLToJSON(vpaCRDRaw)
6463
Expect(err).ToNot(HaveOccurred(), "could not convert vpa crd to json")
6564

6665
err = json.Unmarshal(data, &vpaCRD)

test/e2e/crd_e2e_test.go

+24
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ var _ = Describe("CRD Versions", func() {
127127
Name: "v2alpha1",
128128
Served: true,
129129
Storage: false,
130+
Schema: &apiextensions.CustomResourceValidation{
131+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
132+
Type: "object",
133+
Description: "my crd schema",
134+
},
135+
},
130136
},
131137
},
132138
Names: apiextensions.CustomResourceDefinitionNames{
@@ -163,6 +169,12 @@ var _ = Describe("CRD Versions", func() {
163169
Name: "v2alpha2",
164170
Served: true,
165171
Storage: false,
172+
Schema: &apiextensions.CustomResourceValidation{
173+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
174+
Type: "object",
175+
Description: "my crd schema",
176+
},
177+
},
166178
},
167179
},
168180
Names: apiextensions.CustomResourceDefinitionNames{
@@ -281,6 +293,12 @@ var _ = Describe("CRD Versions", func() {
281293
Name: "v1alpha1",
282294
Served: true,
283295
Storage: true,
296+
Schema: &apiextensionsv1.CustomResourceValidation{
297+
OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
298+
Type: "object",
299+
Description: "my crd schema",
300+
},
301+
},
284302
},
285303
},
286304
Names: apiextensionsv1.CustomResourceDefinitionNames{
@@ -332,6 +350,12 @@ var _ = Describe("CRD Versions", func() {
332350
Name: "v1alpha2",
333351
Served: true,
334352
Storage: true,
353+
Schema: &apiextensions.CustomResourceValidation{
354+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
355+
Type: "object",
356+
Description: "my crd schema",
357+
},
358+
},
335359
},
336360
},
337361
Names: apiextensions.CustomResourceDefinitionNames{

test/e2e/csv_e2e_test.go

+131-16
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,20 @@ var _ = Describe("ClusterServiceVersion", func() {
879879
Name: crdName,
880880
},
881881
Spec: apiextensions.CustomResourceDefinitionSpec{
882-
Group: "cluster.com",
883-
Version: "v1alpha1",
882+
Group: "cluster.com",
883+
Versions: []apiextensions.CustomResourceDefinitionVersion{
884+
{
885+
Name: "v1alpha1",
886+
Served: true,
887+
Storage: true,
888+
Schema: &apiextensions.CustomResourceValidation{
889+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
890+
Type: "object",
891+
Description: "my crd schema",
892+
},
893+
},
894+
},
895+
},
884896
Names: apiextensions.CustomResourceDefinitionNames{
885897
Plural: crdPlural,
886898
Singular: crdPlural,
@@ -1206,8 +1218,20 @@ var _ = Describe("ClusterServiceVersion", func() {
12061218
Name: crdName,
12071219
},
12081220
Spec: apiextensions.CustomResourceDefinitionSpec{
1209-
Group: "cluster.com",
1210-
Version: "v1alpha1",
1221+
Group: "cluster.com",
1222+
Versions: []apiextensions.CustomResourceDefinitionVersion{
1223+
{
1224+
Name: "v1alpha1",
1225+
Served: true,
1226+
Storage: true,
1227+
Schema: &apiextensions.CustomResourceValidation{
1228+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
1229+
Type: "object",
1230+
Description: "my crd schema",
1231+
},
1232+
},
1233+
},
1234+
},
12111235
Names: apiextensions.CustomResourceDefinitionNames{
12121236
Plural: crdPlural,
12131237
Singular: crdPlural,
@@ -2337,14 +2361,27 @@ var _ = Describe("ClusterServiceVersion", func() {
23372361
Name: crdName,
23382362
},
23392363
Spec: apiextensions.CustomResourceDefinitionSpec{
2340-
Group: "cluster.com",
2341-
Version: "v1alpha1",
2364+
Group: "cluster.com",
2365+
Versions: []apiextensions.CustomResourceDefinitionVersion{
2366+
{
2367+
Name: "v1alpha1",
2368+
Served: true,
2369+
Storage: true,
2370+
Schema: &apiextensions.CustomResourceValidation{
2371+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
2372+
Type: "object",
2373+
Description: "my crd schema",
2374+
},
2375+
},
2376+
},
2377+
},
23422378
Names: apiextensions.CustomResourceDefinitionNames{
23432379
Plural: crdPlural,
23442380
Singular: crdPlural,
23452381
Kind: crdPlural,
23462382
ListKind: "list" + crdPlural,
23472383
},
2384+
23482385
Scope: "Namespaced",
23492386
},
23502387
})
@@ -2517,8 +2554,20 @@ var _ = Describe("ClusterServiceVersion", func() {
25172554
Name: crdName,
25182555
},
25192556
Spec: apiextensions.CustomResourceDefinitionSpec{
2520-
Group: "cluster.com",
2521-
Version: "v1alpha1",
2557+
Group: "cluster.com",
2558+
Versions: []apiextensions.CustomResourceDefinitionVersion{
2559+
{
2560+
Name: "v1alpha1",
2561+
Served: true,
2562+
Storage: true,
2563+
Schema: &apiextensions.CustomResourceValidation{
2564+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
2565+
Type: "object",
2566+
Description: "my crd schema",
2567+
},
2568+
},
2569+
},
2570+
},
25222571
Names: apiextensions.CustomResourceDefinitionNames{
25232572
Plural: crdPlural,
25242573
Singular: crdPlural,
@@ -2701,6 +2750,12 @@ var _ = Describe("ClusterServiceVersion", func() {
27012750
Name: "v1alpha1",
27022751
Served: true,
27032752
Storage: true,
2753+
Schema: &apiextensions.CustomResourceValidation{
2754+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
2755+
Type: "object",
2756+
Description: "my crd schema",
2757+
},
2758+
},
27042759
},
27052760
},
27062761
Names: apiextensions.CustomResourceDefinitionNames{
@@ -2879,8 +2934,20 @@ var _ = Describe("ClusterServiceVersion", func() {
28792934
Name: crdName,
28802935
},
28812936
Spec: apiextensions.CustomResourceDefinitionSpec{
2882-
Group: "cluster.com",
2883-
Version: "v1alpha1",
2937+
Group: "cluster.com",
2938+
Versions: []apiextensions.CustomResourceDefinitionVersion{
2939+
{
2940+
Name: "v1alpha1",
2941+
Served: true,
2942+
Storage: true,
2943+
Schema: &apiextensions.CustomResourceValidation{
2944+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
2945+
Type: "object",
2946+
Description: "my crd schema",
2947+
},
2948+
},
2949+
},
2950+
},
28842951
Names: apiextensions.CustomResourceDefinitionNames{
28852952
Plural: crdPlural,
28862953
Singular: crdPlural,
@@ -3033,11 +3100,23 @@ var _ = Describe("ClusterServiceVersion", func() {
30333100
Name: "v1alpha1",
30343101
Served: true,
30353102
Storage: true,
3103+
Schema: &apiextensions.CustomResourceValidation{
3104+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
3105+
Type: "object",
3106+
Description: "my crd schema",
3107+
},
3108+
},
30363109
},
30373110
{
30383111
Name: "v1alpha2",
30393112
Served: true,
30403113
Storage: false,
3114+
Schema: &apiextensions.CustomResourceValidation{
3115+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
3116+
Type: "object",
3117+
Description: "my crd schema",
3118+
},
3119+
},
30413120
},
30423121
},
30433122
Names: apiextensions.CustomResourceDefinitionNames{
@@ -3304,8 +3383,20 @@ var _ = Describe("ClusterServiceVersion", func() {
33043383
Name: crdName,
33053384
},
33063385
Spec: apiextensions.CustomResourceDefinitionSpec{
3307-
Group: "cluster.com",
3308-
Version: "v1alpha1",
3386+
Group: "cluster.com",
3387+
Versions: []apiextensions.CustomResourceDefinitionVersion{
3388+
{
3389+
Name: "v1alpha1",
3390+
Served: true,
3391+
Storage: true,
3392+
Schema: &apiextensions.CustomResourceValidation{
3393+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
3394+
Type: "object",
3395+
Description: "my crd schema",
3396+
},
3397+
},
3398+
},
3399+
},
33093400
Names: apiextensions.CustomResourceDefinitionNames{
33103401
Plural: crdPlural,
33113402
Singular: crdPlural,
@@ -3456,8 +3547,20 @@ var _ = Describe("ClusterServiceVersion", func() {
34563547
Name: crdName,
34573548
},
34583549
Spec: apiextensions.CustomResourceDefinitionSpec{
3459-
Group: "cluster.com",
3460-
Version: "v1alpha1",
3550+
Group: "cluster.com",
3551+
Versions: []apiextensions.CustomResourceDefinitionVersion{
3552+
{
3553+
Name: "v1alpha1",
3554+
Served: true,
3555+
Storage: true,
3556+
Schema: &apiextensions.CustomResourceValidation{
3557+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
3558+
Type: "object",
3559+
Description: "my crd schema",
3560+
},
3561+
},
3562+
},
3563+
},
34613564
Names: apiextensions.CustomResourceDefinitionNames{
34623565
Plural: crdPlural,
34633566
Singular: crdPlural,
@@ -3674,8 +3777,20 @@ var _ = Describe("ClusterServiceVersion", func() {
36743777
Name: crdName,
36753778
},
36763779
Spec: apiextensions.CustomResourceDefinitionSpec{
3677-
Group: "cluster.com",
3678-
Version: "v1alpha1",
3780+
Group: "cluster.com",
3781+
Versions: []apiextensions.CustomResourceDefinitionVersion{
3782+
{
3783+
Name: "v1alpha1",
3784+
Served: true,
3785+
Storage: true,
3786+
Schema: &apiextensions.CustomResourceValidation{
3787+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
3788+
Type: "object",
3789+
Description: "my crd schema",
3790+
},
3791+
},
3792+
},
3793+
},
36793794
Names: apiextensions.CustomResourceDefinitionNames{
36803795
Plural: crdPlural,
36813796
Singular: crdPlural,

0 commit comments

Comments
 (0)