@@ -33,10 +33,18 @@ import (
33
33
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
34
34
"sigs.k8s.io/cluster-api/util"
35
35
36
+ "sigs.k8s.io/cluster-api-provider-ibmcloud/test/helpers"
37
+
36
38
. "github.com/onsi/ginkgo/v2"
37
39
. "github.com/onsi/gomega"
38
40
)
39
41
42
+ const (
43
+ powervsRemediationFlavor = "powervs-md-remediation"
44
+ kubernetesVersion = "KUBERNETES_VERSION"
45
+ serviceInstanceID = "IBMPOWERVS_SERVICE_INSTANCE_ID"
46
+ )
47
+
40
48
var _ = Describe ("Workload cluster creation" , func () {
41
49
var (
42
50
ctx = context .TODO ()
@@ -55,7 +63,7 @@ var _ = Describe("Workload cluster creation", func() {
55
63
Expect (bootstrapClusterProxy ).ToNot (BeNil (), "Invalid argument. bootstrapClusterProxy can't be nil when calling %s spec" , specName )
56
64
Expect (os .MkdirAll (artifactFolder , 0750 )).To (Succeed (), "Invalid argument. artifactFolder can't be created for %s spec" , specName )
57
65
58
- Expect (e2eConfig .Variables ).To (HaveKey (KubernetesVersion ))
66
+ Expect (e2eConfig .Variables ).To (HaveKey (kubernetesVersion ))
59
67
60
68
clusterName = fmt .Sprintf ("capibm-e2e-%s" , util .RandomString (6 ))
61
69
@@ -70,6 +78,13 @@ var _ = Describe("Workload cluster creation", func() {
70
78
// Path to the CNI file is defined in the config
71
79
Expect (e2eConfig .Variables ).To (HaveKey (capi_e2e .CNIPath ), "Missing %s variable in the config" , capi_e2e .CNIPath )
72
80
cniPath = e2eConfig .GetVariable (capi_e2e .CNIPath )
81
+
82
+ if flavor == powervsRemediationFlavor {
83
+ Expect (e2eConfig .Variables ).To (HaveKey (serviceInstanceID ))
84
+ if err := helpers .CheckPowerVSInstances (e2eConfig .GetVariable (serviceInstanceID )); err != nil {
85
+ os .Exit (1 )
86
+ }
87
+ }
73
88
})
74
89
75
90
AfterEach (func () {
@@ -100,7 +115,7 @@ var _ = Describe("Workload cluster creation", func() {
100
115
Flavor : flavor ,
101
116
Namespace : namespace .Name ,
102
117
ClusterName : clusterName ,
103
- KubernetesVersion : e2eConfig .GetVariable (KubernetesVersion ),
118
+ KubernetesVersion : e2eConfig .GetVariable (kubernetesVersion ),
104
119
ControlPlaneMachineCount : ptr .To (int64 (1 )),
105
120
WorkerMachineCount : ptr .To (int64 (1 )),
106
121
},
@@ -121,7 +136,7 @@ var _ = Describe("Workload cluster creation", func() {
121
136
Flavor : flavor ,
122
137
Namespace : namespace .Name ,
123
138
ClusterName : clusterName ,
124
- KubernetesVersion : e2eConfig .GetVariable (KubernetesVersion ),
139
+ KubernetesVersion : e2eConfig .GetVariable (kubernetesVersion ),
125
140
ControlPlaneMachineCount : ptr .To (int64 (1 )),
126
141
WorkerMachineCount : ptr .To (int64 (3 )),
127
142
},
@@ -146,7 +161,7 @@ var _ = Describe("Workload cluster creation", func() {
146
161
Flavor : flavor ,
147
162
Namespace : namespace .Name ,
148
163
ClusterName : clusterName ,
149
- KubernetesVersion : e2eConfig .GetVariable (KubernetesVersion ),
164
+ KubernetesVersion : e2eConfig .GetVariable (kubernetesVersion ),
150
165
ControlPlaneMachineCount : ptr .To (int64 (3 )),
151
166
WorkerMachineCount : ptr .To (int64 (1 )),
152
167
},
0 commit comments