@@ -2,6 +2,8 @@ package e2e
2
2
3
3
import (
4
4
"context"
5
+ "k8s.io/apimachinery/pkg/runtime/schema"
6
+ "k8s.io/client-go/dynamic"
5
7
6
8
. "github.com/onsi/ginkgo"
7
9
. "github.com/onsi/gomega"
@@ -17,25 +19,25 @@ var _ = Describe("Installing bundles with new object types", func() {
17
19
var (
18
20
kubeClient operatorclient.ClientInterface
19
21
operatorClient versioned.Interface
22
+ dynamicClient dynamic.Interface
20
23
)
21
24
22
25
BeforeEach (func () {
23
26
kubeClient = ctx .Ctx ().KubeClient ()
24
27
operatorClient = ctx .Ctx ().OperatorClient ()
28
+ dynamicClient = ctx .Ctx ().DynamicClient ()
25
29
})
26
30
27
31
AfterEach (func () {
28
32
cleaner .NotifyTestComplete (true )
29
33
})
30
34
31
- When ("a bundle with a pdb, priorityclass, and vpa object is installed" , func () {
35
+ When ("a bundle with a pdb, priorityclass, and VPA object is installed" , func () {
36
+ By ("including the VPA CRD in the CSV" )
32
37
const (
33
- packageName = "busybox"
34
- channelName = "alpha"
35
- subName = "test-subscription"
36
- pdbName = "busybox-pdb"
37
- priorityClassName = "high-priority"
38
- vpaName = "busybox-vpa"
38
+ packageName = "busybox"
39
+ channelName = "alpha"
40
+ subName = "test-subscription"
39
41
)
40
42
41
43
BeforeEach (func () {
@@ -74,6 +76,21 @@ var _ = Describe("Installing bundles with new object types", func() {
74
76
})
75
77
76
78
It ("should create the additional bundle objects" , func () {
79
+ const (
80
+ vpaGroup = "autoscaling.k8s.io"
81
+ vpaVersion = "v1"
82
+ vpaResource = "verticalpodautoscalers"
83
+ pdbName = "busybox-pdb"
84
+ priorityClassName = "high-priority"
85
+ vpaName = "busybox-vpa"
86
+ )
87
+
88
+ var resource = schema.GroupVersionResource {
89
+ Group : vpaGroup ,
90
+ Version : vpaVersion ,
91
+ Resource : vpaResource ,
92
+ }
93
+
77
94
// confirm extra bundle objects are installed
78
95
Eventually (func () error {
79
96
_ , err := kubeClient .KubernetesInterface ().PolicyV1beta1 ().PodDisruptionBudgets (testNamespace ).Get (context .TODO (), pdbName , metav1.GetOptions {})
@@ -85,7 +102,10 @@ var _ = Describe("Installing bundles with new object types", func() {
85
102
return err
86
103
}).Should (Succeed (), "expected no error getting priorityclass object associated with CSV" )
87
104
88
- // TODO check VPA object
105
+ Eventually (func () error {
106
+ _ , err := dynamicClient .Resource (resource ).Namespace (testNamespace ).Get (context .TODO (), vpaName , metav1.GetOptions {})
107
+ return err
108
+ }).Should (Succeed (), "expected no error finding vpa object associated with csv" )
89
109
})
90
110
})
91
111
})
0 commit comments