@@ -23,10 +23,11 @@ import (
23
23
addonsv1 "sigs.k8s.io/cluster-api-addon-provider-helm/api/v1alpha1"
24
24
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
25
25
"sigs.k8s.io/cluster-api/test/framework"
26
- "sigs.k8s.io/cluster-api/test/framework/bootstrap"
26
+ capibootstrap "sigs.k8s.io/cluster-api/test/framework/bootstrap"
27
27
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
28
28
ctrl "sigs.k8s.io/controller-runtime"
29
29
30
+ "github.com/d2iq-labs/capi-runtime-extensions/test/framework/bootstrap"
30
31
clusterctltemp "github.com/d2iq-labs/capi-runtime-extensions/test/framework/clusterctl"
31
32
)
32
33
@@ -56,6 +57,18 @@ func init() { //nolint:gochecknoinits // Idiomatically used to set up flags.
56
57
false ,
57
58
"if true, the test uses the current cluster instead of creating a new one (default discovery rules apply)" ,
58
59
)
60
+ flag .StringVar (
61
+ & bootstrapNodeImageRepository ,
62
+ "e2e.bootstrap-kind-image" ,
63
+ "ghcr.io/mesosphere/kind-node" ,
64
+ "the image to use for the bootstrap cluster" ,
65
+ )
66
+ flag .StringVar (
67
+ & bootstrapKubernetesVersion ,
68
+ "e2e.bootstrap-kind-version" ,
69
+ "v1.29.2" ,
70
+ "the version of the image used in bootstrap cluster" ,
71
+ )
59
72
}
60
73
61
74
func TestE2E (t * testing.T ) {
@@ -189,16 +202,20 @@ func setupBootstrapCluster(
189
202
config * clusterctl.E2EConfig ,
190
203
scheme * runtime.Scheme ,
191
204
useExistingCluster bool ,
192
- ) (bootstrap .ClusterProvider , framework.ClusterProxy ) {
193
- var clusterProvider bootstrap .ClusterProvider
205
+ ) (capibootstrap .ClusterProvider , framework.ClusterProxy ) {
206
+ var clusterProvider capibootstrap .ClusterProvider
194
207
kubeconfigPath := ""
195
208
if ! useExistingCluster {
196
209
clusterProvider = bootstrap .CreateKindBootstrapClusterAndLoadImages (
197
210
context .TODO (),
198
211
bootstrap.CreateKindBootstrapClusterAndLoadImagesInput {
199
- Name : config .ManagementClusterName ,
200
- RequiresDockerSock : config .HasDockerProvider (),
201
- Images : config .Images ,
212
+ NodeImageRepository : bootstrapNodeImageRepository ,
213
+ CreateKindBootstrapClusterAndLoadImagesInput : capibootstrap.CreateKindBootstrapClusterAndLoadImagesInput {
214
+ Name : config .ManagementClusterName ,
215
+ RequiresDockerSock : config .HasDockerProvider (),
216
+ Images : config .Images ,
217
+ KubernetesVersion : bootstrapKubernetesVersion ,
218
+ },
202
219
},
203
220
)
204
221
Expect (clusterProvider ).NotTo (BeNil (), "Failed to create a bootstrap cluster" )
@@ -209,11 +226,11 @@ func setupBootstrapCluster(
209
226
).To (BeAnExistingFile (), "Failed to get the kubeconfig file for the bootstrap cluster" )
210
227
} else {
211
228
// Loading image for already created cluster
212
- imagesInput := bootstrap .LoadImagesToKindClusterInput {
229
+ imagesInput := capibootstrap .LoadImagesToKindClusterInput {
213
230
Name : "cre-e2e" ,
214
231
Images : config .Images ,
215
232
}
216
- err := bootstrap .LoadImagesToKindCluster (context .TODO (), imagesInput )
233
+ err := capibootstrap .LoadImagesToKindCluster (context .TODO (), imagesInput )
217
234
Expect (err ).To (BeNil (), "Failed to load images to the bootstrap cluster: %s" , err )
218
235
}
219
236
@@ -245,7 +262,7 @@ func initBootstrapCluster(
245
262
}
246
263
247
264
func tearDown (
248
- bootstrapClusterProvider bootstrap .ClusterProvider ,
265
+ bootstrapClusterProvider capibootstrap .ClusterProvider ,
249
266
bootstrapClusterProxy framework.ClusterProxy ,
250
267
) {
251
268
if bootstrapClusterProxy != nil {
0 commit comments