Skip to content

Commit 1956627

Browse files
exdxbenluddy
authored andcommitted
bump VPA crd to v1; use new embed directive in vpa e2e test
Signed-off-by: Daniel Sover <[email protected]>
1 parent 4080bb4 commit 1956627

File tree

4 files changed

+32
-293
lines changed

4 files changed

+32
-293
lines changed

.github/workflows/e2e-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12+
- uses: actions/setup-go@v2
13+
with:
14+
go-version: '~1.16'
1215
- run: make e2e-local NODES=2 JUNIT_DIRECTORY=./artifacts/
1316
- name: Archive Test Artifacts # test results, failed or not, are always uploaded.
1417
if: ${{ always() }}

test/e2e/bundle_e2e_test.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package e2e
22

33
import (
44
"context"
5+
_ "embed"
56
"encoding/json"
67

78
"github.com/ghodss/yaml"
@@ -19,9 +20,11 @@ import (
1920
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
2021
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
2122
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
22-
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/testdata/vpa"
2323
)
2424

25+
//go:embed testdata/vpa/crd.yaml
26+
var vpaCRDraw []byte
27+
2528
var _ = Describe("Installing bundles with new object types", func() {
2629
var (
2730
kubeClient operatorclient.ClientInterface
@@ -56,10 +59,8 @@ var _ = Describe("Installing bundles with new object types", func() {
5659
)
5760

5861
// create VPA CRD on cluster
59-
y, err := vpa.Asset("test/e2e/testdata/vpa/crd.yaml")
60-
Expect(err).ToNot(HaveOccurred(), "could not read vpa bindata")
61-
62-
data, err := yaml.YAMLToJSON(y)
62+
Expect(vpaCRDraw).ToNot(BeEmpty(), "could not read vpa bindata")
63+
data, err := yaml.YAMLToJSON(vpaCRDraw)
6364
Expect(err).ToNot(HaveOccurred(), "could not convert vpa crd to json")
6465

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

test/e2e/testdata/vpa/crd.yaml

+23-35
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: verticalpodautoscalers.autoscaling.k8s.io
@@ -13,52 +13,40 @@ spec:
1313
kind: VerticalPodAutoscaler
1414
shortNames:
1515
- vpa
16-
version: v1beta1
1716
versions:
1817
- name: v1beta1
1918
served: false
2019
storage: false
20+
schema:
21+
openAPIV3Schema:
22+
type: object
23+
properties:
24+
spec:
25+
type: object
26+
properties:
27+
name:
28+
type: string
2129
- name: v1beta2
2230
served: true
2331
storage: true
32+
schema:
33+
openAPIV3Schema:
34+
type: object
35+
properties:
36+
spec:
37+
type: object
38+
properties:
39+
name:
40+
type: string
2441
- name: v1
2542
served: true
2643
storage: false
27-
validation:
28-
# openAPIV3Schema is the schema for validating custom objects.
29-
openAPIV3Schema:
30-
type: object
31-
properties:
32-
spec:
44+
schema:
45+
openAPIV3Schema:
3346
type: object
34-
required: []
3547
properties:
36-
targetRef:
37-
type: object
38-
updatePolicy:
48+
spec:
3949
type: object
4050
properties:
41-
updateMode:
51+
name:
4252
type: string
43-
resourcePolicy:
44-
type: object
45-
properties:
46-
containerPolicies:
47-
type: array
48-
items:
49-
type: object
50-
properties:
51-
containerName:
52-
type: string
53-
mode:
54-
type: string
55-
enum: ["Auto", "Off"]
56-
minAllowed:
57-
type: object
58-
maxAllowed:
59-
type: object
60-
controlledResources:
61-
type: array
62-
items:
63-
type: string
64-
enum: ["cpu", "memory"]

test/e2e/testdata/vpa/vpa_bindata.go

-253
This file was deleted.

0 commit comments

Comments
 (0)