Skip to content

Commit

Permalink
bump VPA crd to v1; use new embed directive in vpa e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sover <dsover@redhat.com>
  • Loading branch information
exdx authored and benluddy committed Jul 9, 2021
1 parent 4080bb4 commit 1956627
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 293 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '~1.16'
- run: make e2e-local NODES=2 JUNIT_DIRECTORY=./artifacts/
- name: Archive Test Artifacts # test results, failed or not, are always uploaded.
if: ${{ always() }}
Expand Down
11 changes: 6 additions & 5 deletions test/e2e/bundle_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2e

import (
"context"
_ "embed"
"encoding/json"

"github.com/ghodss/yaml"
Expand All @@ -19,9 +20,11 @@ import (
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/testdata/vpa"
)

//go:embed testdata/vpa/crd.yaml
var vpaCRDraw []byte

var _ = Describe("Installing bundles with new object types", func() {
var (
kubeClient operatorclient.ClientInterface
Expand Down Expand Up @@ -56,10 +59,8 @@ var _ = Describe("Installing bundles with new object types", func() {
)

// create VPA CRD on cluster
y, err := vpa.Asset("test/e2e/testdata/vpa/crd.yaml")
Expect(err).ToNot(HaveOccurred(), "could not read vpa bindata")

data, err := yaml.YAMLToJSON(y)
Expect(vpaCRDraw).ToNot(BeEmpty(), "could not read vpa bindata")
data, err := yaml.YAMLToJSON(vpaCRDraw)
Expect(err).ToNot(HaveOccurred(), "could not convert vpa crd to json")

err = json.Unmarshal(data, &vpaCRD)
Expand Down
58 changes: 23 additions & 35 deletions test/e2e/testdata/vpa/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: verticalpodautoscalers.autoscaling.k8s.io
Expand All @@ -13,52 +13,40 @@ spec:
kind: VerticalPodAutoscaler
shortNames:
- vpa
version: v1beta1
versions:
- name: v1beta1
served: false
storage: false
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
name:
type: string
- name: v1beta2
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
name:
type: string
- name: v1
served: true
storage: false
validation:
# openAPIV3Schema is the schema for validating custom objects.
openAPIV3Schema:
type: object
properties:
spec:
schema:
openAPIV3Schema:
type: object
required: []
properties:
targetRef:
type: object
updatePolicy:
spec:
type: object
properties:
updateMode:
name:
type: string
resourcePolicy:
type: object
properties:
containerPolicies:
type: array
items:
type: object
properties:
containerName:
type: string
mode:
type: string
enum: ["Auto", "Off"]
minAllowed:
type: object
maxAllowed:
type: object
controlledResources:
type: array
items:
type: string
enum: ["cpu", "memory"]
253 changes: 0 additions & 253 deletions test/e2e/testdata/vpa/vpa_bindata.go

This file was deleted.

0 comments on commit 1956627

Please sign in to comment.