@@ -29,7 +29,7 @@ import (
29
29
. "github.com/onsi/gomega"
30
30
31
31
corev1 "k8s.io/api/core/v1"
32
- "k8s.io/utils/pointer "
32
+ "k8s.io/utils/ptr "
33
33
34
34
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
35
35
"sigs.k8s.io/cluster-api/util"
@@ -44,6 +44,7 @@ var _ = Describe("Workload cluster creation", func() {
44
44
result * ApplyClusterTemplateAndWaitResult
45
45
clusterName string
46
46
clusterctlLogFolder string
47
+ registrationIP string
47
48
)
48
49
49
50
BeforeEach (func () {
@@ -54,6 +55,8 @@ var _ = Describe("Workload cluster creation", func() {
54
55
55
56
Expect (e2eConfig .Variables ).To (HaveKey (KubernetesVersion ))
56
57
58
+ registrationIP = randomIp ()
59
+
57
60
By ("Initializing the bootstrap cluster" )
58
61
initBootstrapCluster (bootstrapClusterProxy , e2eConfig , clusterctlConfigPath , artifactFolder )
59
62
@@ -97,8 +100,11 @@ var _ = Describe("Workload cluster creation", func() {
97
100
Namespace : namespace .Name ,
98
101
ClusterName : clusterName ,
99
102
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersion ),
100
- ControlPlaneMachineCount : pointer .Int64Ptr (1 ),
101
- WorkerMachineCount : pointer .Int64Ptr (1 ),
103
+ ControlPlaneMachineCount : ptr .To (int64 (1 )),
104
+ WorkerMachineCount : ptr .To (int64 (1 )),
105
+ ClusterctlVariables : map [string ]string {
106
+ "REGISTRATION_VIP" : registrationIP ,
107
+ },
102
108
},
103
109
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
104
110
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
@@ -118,8 +124,11 @@ var _ = Describe("Workload cluster creation", func() {
118
124
Namespace : namespace .Name ,
119
125
ClusterName : clusterName ,
120
126
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersion ),
121
- ControlPlaneMachineCount : pointer .Int64Ptr (1 ),
122
- WorkerMachineCount : pointer .Int64Ptr (3 ),
127
+ ControlPlaneMachineCount : ptr .To (int64 (1 )),
128
+ WorkerMachineCount : ptr .To (int64 (3 )),
129
+ ClusterctlVariables : map [string ]string {
130
+ "REGISTRATION_VIP" : registrationIP ,
131
+ },
123
132
},
124
133
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
125
134
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
@@ -138,8 +147,11 @@ var _ = Describe("Workload cluster creation", func() {
138
147
Namespace : namespace .Name ,
139
148
ClusterName : clusterName ,
140
149
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersionUpgradeTo ),
141
- ControlPlaneMachineCount : pointer .Int64Ptr (1 ),
142
- WorkerMachineCount : pointer .Int64Ptr (3 ),
150
+ ControlPlaneMachineCount : ptr .To (int64 (1 )),
151
+ WorkerMachineCount : ptr .To (int64 (3 )),
152
+ ClusterctlVariables : map [string ]string {
153
+ "REGISTRATION_VIP" : registrationIP ,
154
+ },
143
155
},
144
156
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
145
157
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
@@ -171,8 +183,11 @@ var _ = Describe("Workload cluster creation", func() {
171
183
Namespace : namespace .Name ,
172
184
ClusterName : clusterName ,
173
185
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersionUpgradeTo ),
174
- ControlPlaneMachineCount : pointer .Int64Ptr (3 ),
175
- WorkerMachineCount : pointer .Int64Ptr (3 ),
186
+ ControlPlaneMachineCount : ptr .To (int64 (3 )),
187
+ WorkerMachineCount : ptr .To (int64 (3 )),
188
+ ClusterctlVariables : map [string ]string {
189
+ "REGISTRATION_VIP" : registrationIP ,
190
+ },
176
191
},
177
192
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
178
193
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
@@ -197,8 +212,11 @@ var _ = Describe("Workload cluster creation", func() {
197
212
Namespace : namespace .Name ,
198
213
ClusterName : clusterName ,
199
214
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersionUpgradeTo ),
200
- ControlPlaneMachineCount : pointer .Int64Ptr (1 ),
201
- WorkerMachineCount : pointer .Int64Ptr (3 ),
215
+ ControlPlaneMachineCount : ptr .To (int64 (1 )),
216
+ WorkerMachineCount : ptr .To (int64 (3 )),
217
+ ClusterctlVariables : map [string ]string {
218
+ "REGISTRATION_VIP" : registrationIP ,
219
+ },
202
220
},
203
221
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
204
222
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
@@ -223,8 +241,11 @@ var _ = Describe("Workload cluster creation", func() {
223
241
Namespace : namespace .Name ,
224
242
ClusterName : clusterName ,
225
243
KubernetesVersion : e2eConfig .GetVariable (KubernetesVersionUpgradeTo ),
226
- ControlPlaneMachineCount : pointer .Int64Ptr (1 ),
227
- WorkerMachineCount : pointer .Int64Ptr (1 ),
244
+ ControlPlaneMachineCount : ptr .To (int64 (1 )),
245
+ WorkerMachineCount : ptr .To (int64 (1 )),
246
+ ClusterctlVariables : map [string ]string {
247
+ "REGISTRATION_VIP" : registrationIP ,
248
+ },
228
249
},
229
250
WaitForClusterIntervals : e2eConfig .GetIntervals (specName , "wait-cluster" ),
230
251
WaitForControlPlaneIntervals : e2eConfig .GetIntervals (specName , "wait-control-plane" ),
0 commit comments