From ccb8ae90ab8a782933422330bbe00bccf8b17496 Mon Sep 17 00:00:00 2001 From: kavyashree-r <71521316+kavyashree-r@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:10:13 +0530 Subject: [PATCH] Removed local declarations of busy box image (#2402) (#2426) --- tests/e2e/docs/guest_cluster_setup.md | 1 + tests/e2e/docs/multimaster_cluster_setup.md | 1 + tests/e2e/docs/supervisor_cluster_setup.md | 1 + tests/e2e/docs/topology_aware_vanilla_setup.md | 1 + tests/e2e/docs/vanilla_cluster_setup.md | 1 + tests/e2e/docs/vmc_tkg_setup.md | 1 + tests/e2e/e2e_common.go | 9 +++++++-- tests/e2e/suite_test.go | 6 ++++++ 8 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/e2e/docs/guest_cluster_setup.md b/tests/e2e/docs/guest_cluster_setup.md index c0fa27651f..bbef67bf17 100644 --- a/tests/e2e/docs/guest_cluster_setup.md +++ b/tests/e2e/docs/guest_cluster_setup.md @@ -98,6 +98,7 @@ The section outlines how to set the env variable for running e2e test. export SHARED_NFS_DATASTORE_URL="" #shared VMFS datastore url export SHARED_VMFS_DATASTORE_URL="" + export BUSYBOX_IMAGE="" # `STORAGE_POLICY_FOR_SHARED_DATASTORES` and `STORAGE_POLICY_FOR_NONSHARED_DATASTORES` need to be # added to `SVC_NAMESPACE` with storage limit >=20GiB each diff --git a/tests/e2e/docs/multimaster_cluster_setup.md b/tests/e2e/docs/multimaster_cluster_setup.md index 864b01f956..ce09f914c6 100644 --- a/tests/e2e/docs/multimaster_cluster_setup.md +++ b/tests/e2e/docs/multimaster_cluster_setup.md @@ -50,6 +50,7 @@ SSH keys need to be configured properley for all three master nodes of K8S clust export STORAGE_POLICY_FOR_SHARED_DATASTORES="vSAN Default Storage Policy" export USER=root export GINKGO_FOCUS="csi-multi-master-block-e2e" + export BUSYBOX_IMAGE="" ## Requirements diff --git a/tests/e2e/docs/supervisor_cluster_setup.md b/tests/e2e/docs/supervisor_cluster_setup.md index 6adb3e7c19..8f2c5bc4c6 100644 --- a/tests/e2e/docs/supervisor_cluster_setup.md +++ b/tests/e2e/docs/supervisor_cluster_setup.md @@ -98,6 +98,7 @@ datacenters should be comma separated if deployed on multi-datacenters export SHARED_NFS_DATASTORE_URL="" #shared VMFS datastore url export SHARED_VMFS_DATASTORE_URL="" + export BUSYBOX_IMAGE="" ### To run full sync test, need do extra following steps diff --git a/tests/e2e/docs/topology_aware_vanilla_setup.md b/tests/e2e/docs/topology_aware_vanilla_setup.md index 2fe2ae52f9..8d0e4e002b 100644 --- a/tests/e2e/docs/topology_aware_vanilla_setup.md +++ b/tests/e2e/docs/topology_aware_vanilla_setup.md @@ -103,6 +103,7 @@ datacenters should be comma separated if deployed on multi-datacenters export STORAGE_POLICY_FROM_INACCESSIBLE_ZONE="Region-2-shared-datastore-storage-policy" # Datastore URL from the region/zone where worker node VMs do not have a shared datastore export INACCESSIBLE_ZONE_VSPHERE_DATASTORE_URL="Region-2-shared-datastore-storage-url" + export BUSYBOX_IMAGE="" ## Requirements diff --git a/tests/e2e/docs/vanilla_cluster_setup.md b/tests/e2e/docs/vanilla_cluster_setup.md index 0dc8899ed1..20c9163ebf 100644 --- a/tests/e2e/docs/vanilla_cluster_setup.md +++ b/tests/e2e/docs/vanilla_cluster_setup.md @@ -62,6 +62,7 @@ list of datastore URLs where you want to deploy file share volumes. Retrieve thi export USER=root export CLUSTER_FLAVOR="VANILLA" export CSI_NAMESPACE="vmware-system-csi" + export BUSYBOX_IMAGE="" # To run e2e test for block volume, need to set the following env variable export GINKGO_FOCUS="csi-block-vanilla" # To run e2e test for file volume, need to set the following env variable diff --git a/tests/e2e/docs/vmc_tkg_setup.md b/tests/e2e/docs/vmc_tkg_setup.md index d2f7b12420..ceea76bee4 100644 --- a/tests/e2e/docs/vmc_tkg_setup.md +++ b/tests/e2e/docs/vmc_tkg_setup.md @@ -70,6 +70,7 @@ The section outlines how to set the env variable for running the e2e test. export SHARED_VMFS_DATASTORE_URL="" #management datastore url export MANAGEMENT_DATASTORE_URL="" + export BUSYBOX_IMAGE="" # `STORAGE_POLICY_FOR_SHARED_DATASTORES` need to be # added to `SVC_NAMESPACE` with storage limit >=20GiB each diff --git a/tests/e2e/e2e_common.go b/tests/e2e/e2e_common.go index 3fac67d8f7..5a24d40fbc 100644 --- a/tests/e2e/e2e_common.go +++ b/tests/e2e/e2e_common.go @@ -30,8 +30,8 @@ import ( const ( adminPassword = "Admin!23" attacherContainerName = "csi-attacher" - busyBoxImageOnGcr = "gcr.io/google_containers/busybox:1.27" - nginxImage = "k8s.gcr.io/nginx-slim:0.8" + nginxImage = "registry.k8s.io/nginx-slim:0.26" + nginxImage4upg = "registry.k8s.io/nginx-slim:0.27" configSecret = "vsphere-config-secret" contollerClusterKubeConfig = "CONTROLLER_CLUSTER_KUBECONFIG" crdCNSNodeVMAttachment = "cnsnodevmattachments" @@ -218,6 +218,11 @@ var ( rwxAccessMode bool ) +// For busybox pod image +var ( + busyBoxImageOnGcr = "busybox" +) + // For VCP to CSI migration tests. var ( envSharedDatastoreName = "SHARED_VSPHERE_DATASTORE_NAME" diff --git a/tests/e2e/suite_test.go b/tests/e2e/suite_test.go index a4b7c3962c..1a4f73f29e 100644 --- a/tests/e2e/suite_test.go +++ b/tests/e2e/suite_test.go @@ -29,6 +29,7 @@ import ( ) const kubeconfigEnvVar = "KUBECONFIG" +const busyBoxImageEnvVar = "BUSYBOX_IMAGE" func init() { // k8s.io/kubernetes/tests/e2e/framework requires env KUBECONFIG to be set @@ -37,9 +38,14 @@ func init() { kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config") os.Setenv(kubeconfigEnvVar, kubeconfig) } + framework.AfterReadingAllFlags(&framework.TestContext) clusterFlavor := cnstypes.CnsClusterFlavor(os.Getenv(envClusterFlavor)) setClusterFlavor(clusterFlavor) + + if os.Getenv(busyBoxImageEnvVar) != "" { + busyBoxImageOnGcr = os.Getenv(busyBoxImageEnvVar) + } } func TestE2E(t *testing.T) {