@@ -44,9 +44,10 @@ import (
4444)
4545
4646const (
47- KubernetesVersion = "KUBERNETES_VERSION"
48- CNIPath = "CNI"
49- CNIResources = "CNI_RESOURCES"
47+ KubernetesVersion = "KUBERNETES_VERSION"
48+ CNIPath = "CNI"
49+ CNIResources = "CNI_RESOURCES"
50+ CustomKindNodeImage = "CUSTOM_KIND_NODE_IMAGE"
5051)
5152
5253// Test suite flags.
@@ -192,13 +193,24 @@ func createClusterctlLocalRepository(config *clusterctl.E2EConfig, repositoryFol
192193}
193194
194195func setupBootstrapCluster (config * clusterctl.E2EConfig , scheme * runtime.Scheme , useExistingCluster bool ) (bootstrap.ClusterProvider , framework.ClusterProxy ) {
195- var clusterProvider bootstrap.ClusterProvider
196- kubeconfigPath := ""
196+ var (
197+ clusterProvider bootstrap.ClusterProvider
198+ kubeconfigPath string
199+ )
200+ input := bootstrap.CreateKindBootstrapClusterAndLoadImagesInput {
201+ Name : config .ManagementClusterName ,
202+ Images : config .Images ,
203+ }
204+
205+ customImage := config .GetVariableOrEmpty (CustomKindNodeImage )
206+ if customImage != "" {
207+ input .CustomNodeImage = customImage
208+ } else {
209+ input .KubernetesVersion = e2eConfig .MustGetVariable (KubernetesVersion )
210+ }
211+
197212 if ! useExistingCluster {
198- clusterProvider = bootstrap .CreateKindBootstrapClusterAndLoadImages (context .TODO (), bootstrap.CreateKindBootstrapClusterAndLoadImagesInput {
199- Name : config .ManagementClusterName ,
200- Images : config .Images ,
201- })
213+ clusterProvider = bootstrap .CreateKindBootstrapClusterAndLoadImages (context .TODO (), input )
202214 Expect (clusterProvider ).ToNot (BeNil (), "Failed to create a bootstrap cluster" )
203215
204216 kubeconfigPath = clusterProvider .GetKubeconfigPath ()
0 commit comments