diff --git a/scripts/ci-e2e.sh b/scripts/ci-e2e.sh index b591fd191..39d6150ac 100755 --- a/scripts/ci-e2e.sh +++ b/scripts/ci-e2e.sh @@ -181,6 +181,7 @@ main(){ export EXP_CLUSTER_RESOURCE_SET=true export IBMACCOUNT_ID=${IBMACCOUNT_ID:-"7cfbd5381a434af7a09289e795840d4e"} export BASE64_API_KEY=$(tr -d '\n' <<<"$IBMCLOUD_API_KEY" | base64) + export CUSTOM_KIND_NODE_IMAGE=${CUSTOM_KIND_NODE_IMAGE:-} # Setting controller loglevel to allow debug logs from the VPC/PowerVS client export LOGLEVEL=5 diff --git a/test/e2e/config/ibmcloud-e2e-powervs.yaml b/test/e2e/config/ibmcloud-e2e-powervs.yaml index eef1dbe88..6fa8027a3 100644 --- a/test/e2e/config/ibmcloud-e2e-powervs.yaml +++ b/test/e2e/config/ibmcloud-e2e-powervs.yaml @@ -45,6 +45,7 @@ variables: KUBERNETES_VERSION: "${KUBERNETES_VERSION:-v1.33.1}" # Below variable should be set based on the targeted environment SERVICE_ENDPOINT: "${SERVICE_ENDPOINT:-}" + CUSTOM_KIND_NODE_IMAGE: ${CUSTOM_KIND_NODE_IMAGE:-}"" # Cluster Addons CNI: "${PWD}/test/e2e/data/cni/calico/calico.yaml" IP_FAMILY: "IPv4" diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index 8942f737c..f9c26c1fa 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -44,9 +44,10 @@ import ( ) const ( - KubernetesVersion = "KUBERNETES_VERSION" - CNIPath = "CNI" - CNIResources = "CNI_RESOURCES" + KubernetesVersion = "KUBERNETES_VERSION" + CNIPath = "CNI" + CNIResources = "CNI_RESOURCES" + CustomKindNodeImage = "CUSTOM_KIND_NODE_IMAGE" ) // Test suite flags. @@ -192,13 +193,22 @@ func createClusterctlLocalRepository(config *clusterctl.E2EConfig, repositoryFol } func setupBootstrapCluster(config *clusterctl.E2EConfig, scheme *runtime.Scheme, useExistingCluster bool) (bootstrap.ClusterProvider, framework.ClusterProxy) { - var clusterProvider bootstrap.ClusterProvider - kubeconfigPath := "" + var ( + clusterProvider bootstrap.ClusterProvider + kubeconfigPath string + ) + input := bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{ + Name: config.ManagementClusterName, + Images: config.Images, + } + + customImage := config.GetVariableOrEmpty(CustomKindNodeImage) + if customImage != "" { + input.CustomNodeImage = customImage + } + if !useExistingCluster { - clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(context.TODO(), bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{ - Name: config.ManagementClusterName, - Images: config.Images, - }) + clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(context.TODO(), input) Expect(clusterProvider).ToNot(BeNil(), "Failed to create a bootstrap cluster") kubeconfigPath = clusterProvider.GetKubeconfigPath()