From f7f35770354c409b4cc5027445d1c45c9247b567 Mon Sep 17 00:00:00 2001 From: Di Xu Date: Tue, 17 Oct 2017 12:33:38 +0800 Subject: [PATCH] use multi-arch busybox for e2e --- federation/test/e2e/BUILD | 1 - federation/test/e2e/job.go | 3 +-- federation/test/e2e/util.go | 3 +-- test/e2e/apimachinery/garbage_collector.go | 2 +- test/e2e/apimachinery/generated_clientset.go | 2 +- test/e2e/apps/cronjob.go | 3 +-- test/e2e/common/util.go | 4 ++-- test/e2e/framework/nodes_util.go | 3 +-- test/e2e/framework/util.go | 2 +- test/e2e/instrumentation/logging/BUILD | 1 - .../instrumentation/logging/generic_soak.go | 3 +-- test/e2e/kubectl/kubectl.go | 2 +- test/e2e/network/network_policy.go | 2 +- test/e2e/node/BUILD | 1 - test/e2e/node/kubelet.go | 3 +-- test/e2e/node/security_context.go | 3 +-- test/e2e/pod_gc.go | 3 +-- test/e2e/pre_stop.go | 2 +- test/e2e/storage/empty_dir_wrapper.go | 2 +- test/e2e/storage/pd.go | 3 +-- test/e2e/storage/volume_provisioning.go | 3 +-- test/e2e/storage/vsphere_utils.go | 5 ++--- test/e2e/upgrades/configmaps.go | 2 +- test/e2e/upgrades/secrets.go | 2 +- test/e2e/upgrades/sysctl.go | 3 +-- test/e2e_node/docker_test.go | 5 ++--- test/e2e_node/security_context_test.go | 2 +- test/e2e_node/util.go | 3 +-- test/utils/image/manifest.go | 18 ------------------ 29 files changed, 28 insertions(+), 63 deletions(-) diff --git a/federation/test/e2e/BUILD b/federation/test/e2e/BUILD index be0be028596..fc2ea68a058 100644 --- a/federation/test/e2e/BUILD +++ b/federation/test/e2e/BUILD @@ -34,7 +34,6 @@ go_library( "//test/e2e/chaosmonkey:go_default_library", "//test/e2e/common:go_default_library", "//test/e2e/framework:go_default_library", - "//test/utils/image:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/batch/v1:go_default_library", diff --git a/federation/test/e2e/job.go b/federation/test/e2e/job.go index 5e1e3a67927..5c2214dd385 100644 --- a/federation/test/e2e/job.go +++ b/federation/test/e2e/job.go @@ -29,7 +29,6 @@ import ( fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" fedframework "k8s.io/kubernetes/federation/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -279,7 +278,7 @@ func newJobForFed(namespace string, name string, completions int32, parallelism Containers: []v1.Container{ { Name: "sleep", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sleep", "1"}, }, }, diff --git a/federation/test/e2e/util.go b/federation/test/e2e/util.go index f30d039455a..972227d2613 100644 --- a/federation/test/e2e/util.go +++ b/federation/test/e2e/util.go @@ -36,7 +36,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - imageutils "k8s.io/kubernetes/test/utils/image" ) var ( @@ -403,7 +402,7 @@ func discoverService(f *fedframework.Framework, name string, exists bool, podNam Containers: []v1.Container{ { Name: "federated-service-discovery-container", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: command, }, }, diff --git a/test/e2e/apimachinery/garbage_collector.go b/test/e2e/apimachinery/garbage_collector.go index c974167a923..3c250607724 100644 --- a/test/e2e/apimachinery/garbage_collector.go +++ b/test/e2e/apimachinery/garbage_collector.go @@ -288,7 +288,7 @@ func newCronJob(name, schedule string) *batchv1beta1.CronJob { Containers: []v1.Container{ { Name: "c", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sleep", "300"}, }, }, diff --git a/test/e2e/apimachinery/generated_clientset.go b/test/e2e/apimachinery/generated_clientset.go index 7e3a3d00648..6c1ae3972eb 100644 --- a/test/e2e/apimachinery/generated_clientset.go +++ b/test/e2e/apimachinery/generated_clientset.go @@ -243,7 +243,7 @@ func newTestingCronJob(name string, value string) *batchv1beta1.CronJob { Containers: []v1.Container{ { Name: "c", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", VolumeMounts: []v1.VolumeMount{ { MountPath: "/data", diff --git a/test/e2e/apps/cronjob.go b/test/e2e/apps/cronjob.go index 39f5fcdaa1f..571b4ef8c82 100644 --- a/test/e2e/apps/cronjob.go +++ b/test/e2e/apps/cronjob.go @@ -35,7 +35,6 @@ import ( "k8s.io/kubernetes/pkg/controller/job" "k8s.io/kubernetes/pkg/kubectl" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) const ( @@ -304,7 +303,7 @@ func newTestCronJob(name, schedule string, concurrencyPolicy batchv1beta1.Concur Containers: []v1.Container{ { Name: "c", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", VolumeMounts: []v1.VolumeMount{ { MountPath: "/data", diff --git a/test/e2e/common/util.go b/test/e2e/common/util.go index aa6bfc1e98b..c65e9199bb9 100644 --- a/test/e2e/common/util.go +++ b/test/e2e/common/util.go @@ -42,7 +42,7 @@ const ( var ( mountImage = imageutils.GetE2EImage(imageutils.Mounttest) - busyboxImage = imageutils.GetBusyBoxImage() + busyboxImage = "busybox" ) var CurrentSuite Suite @@ -52,7 +52,7 @@ var CurrentSuite Suite // only used by node e2e test. // TODO(random-liu): Change the image puller pod to use similar mechanism. var CommonImageWhiteList = sets.NewString( - imageutils.GetBusyBoxImage(), + "busybox", imageutils.GetE2EImage(imageutils.EntrypointTester), imageutils.GetE2EImage(imageutils.Liveness), imageutils.GetE2EImage(imageutils.Mounttest), diff --git a/test/e2e/framework/nodes_util.go b/test/e2e/framework/nodes_util.go index 5cfd4d95751..0926a8a7703 100644 --- a/test/e2e/framework/nodes_util.go +++ b/test/e2e/framework/nodes_util.go @@ -29,7 +29,6 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" - imageutils "k8s.io/kubernetes/test/utils/image" ) func EtcdUpgrade(target_storage, target_version string) error { @@ -327,7 +326,7 @@ func gceUpgradeScript() string { func waitForSSHTunnels() { Logf("Waiting for SSH tunnels to establish") RunKubectl("run", "ssh-tunnel-test", - "--image="+imageutils.GetBusyBoxImage(), + "--image=busybox", "--restart=Never", "--command", "--", "echo", "Hello") diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 36d0830fb02..92ccc7f2892 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -192,7 +192,7 @@ const ( ) var ( - BusyBoxImage = imageutils.GetBusyBoxImage() + BusyBoxImage = "busybox" // Label allocated to the image puller static pod that runs on each node // before e2es. ImagePullerLabels = map[string]string{"name": "e2e-image-puller"} diff --git a/test/e2e/instrumentation/logging/BUILD b/test/e2e/instrumentation/logging/BUILD index 43f301895c1..6d1698b4138 100644 --- a/test/e2e/instrumentation/logging/BUILD +++ b/test/e2e/instrumentation/logging/BUILD @@ -17,7 +17,6 @@ go_library( "//test/e2e/instrumentation/common:go_default_library", "//test/e2e/instrumentation/logging/elasticsearch:go_default_library", "//test/e2e/instrumentation/logging/stackdrvier:go_default_library", - "//test/utils/image:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/test/e2e/instrumentation/logging/generic_soak.go b/test/e2e/instrumentation/logging/generic_soak.go index d08e9ad22ed..3c94306f066 100644 --- a/test/e2e/instrumentation/logging/generic_soak.go +++ b/test/e2e/instrumentation/logging/generic_soak.go @@ -28,7 +28,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/kubernetes/test/e2e/framework" instrumentation "k8s.io/kubernetes/test/e2e/instrumentation/common" - imageutils "k8s.io/kubernetes/test/utils/image" ) var _ = instrumentation.SIGDescribe("Logging soak [Performance] [Slow] [Disruptive]", func() { @@ -101,7 +100,7 @@ func RunLogPodsWithSleepOf(f *framework.Framework, sleep time.Duration, podname return v1.PodSpec{ Containers: []v1.Container{{ Name: "logging-soak", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Args: []string{ "/bin/sh", "-c", diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index 233707da358..205ddd3ae9a 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -95,7 +95,7 @@ var ( kittenImage = imageutils.GetE2EImage(imageutils.Kitten) redisImage = imageutils.GetE2EImage(imageutils.Redis) nginxImage = imageutils.GetE2EImage(imageutils.NginxSlim) - busyboxImage = imageutils.GetBusyBoxImage() + busyboxImage = "busybox" ) var testImages = struct { diff --git a/test/e2e/network/network_policy.go b/test/e2e/network/network_policy.go index 653187aeb1f..be870744a29 100644 --- a/test/e2e/network/network_policy.go +++ b/test/e2e/network/network_policy.go @@ -514,7 +514,7 @@ func createNetworkClientPod(f *framework.Framework, namespace *v1.Namespace, pod Containers: []v1.Container{ { Name: fmt.Sprintf("%s-container", podName), - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Args: []string{ "/bin/sh", "-c", diff --git a/test/e2e/node/BUILD b/test/e2e/node/BUILD index ad29d21ceb6..b1a2c719cf7 100644 --- a/test/e2e/node/BUILD +++ b/test/e2e/node/BUILD @@ -17,7 +17,6 @@ go_library( "//test/e2e/common:go_default_library", "//test/e2e/framework:go_default_library", "//test/utils:go_default_library", - "//test/utils/image:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/test/e2e/node/kubelet.go b/test/e2e/node/kubelet.go index c5e1c32ca2f..420a2f9f20f 100644 --- a/test/e2e/node/kubelet.go +++ b/test/e2e/node/kubelet.go @@ -34,7 +34,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - imageutils "k8s.io/kubernetes/test/utils/image" ) const ( @@ -170,7 +169,7 @@ func createPodUsingNfs(f *framework.Framework, c clientset.Interface, ns, nfsIP, Containers: []v1.Container{ { Name: "pod-nfs-vol", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"/bin/sh"}, Args: cmdLine, VolumeMounts: []v1.VolumeMount{ diff --git a/test/e2e/node/security_context.go b/test/e2e/node/security_context.go index 118bc650f47..22062836c28 100644 --- a/test/e2e/node/security_context.go +++ b/test/e2e/node/security_context.go @@ -32,7 +32,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - imageutils "k8s.io/kubernetes/test/utils/image" ) func scTestPod(hostIPC bool, hostPID bool) *v1.Pod { @@ -50,7 +49,7 @@ func scTestPod(hostIPC bool, hostPID bool) *v1.Pod { Containers: []v1.Container{ { Name: "test-container", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", }, }, RestartPolicy: v1.RestartPolicyNever, diff --git a/test/e2e/pod_gc.go b/test/e2e/pod_gc.go index ebab2b2a49a..11e0f9acfe1 100644 --- a/test/e2e/pod_gc.go +++ b/test/e2e/pod_gc.go @@ -27,7 +27,6 @@ import ( "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) // This test requires that --terminated-pod-gc-threshold=100 be set on the controller manager @@ -90,7 +89,7 @@ func createTerminatingPod(f *framework.Framework) (*v1.Pod, error) { Containers: []v1.Container{ { Name: string(uuid), - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", }, }, SchedulerName: "please don't schedule my pods", diff --git a/test/e2e/pre_stop.go b/test/e2e/pre_stop.go index 4e4204068c5..93c1f5d29a3 100644 --- a/test/e2e/pre_stop.go +++ b/test/e2e/pre_stop.go @@ -80,7 +80,7 @@ func testPreStop(c clientset.Interface, ns string) { Containers: []v1.Container{ { Name: "tester", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sleep", "600"}, Lifecycle: &v1.Lifecycle{ PreStop: &v1.Handler{ diff --git a/test/e2e/storage/empty_dir_wrapper.go b/test/e2e/storage/empty_dir_wrapper.go index 2a39611017f..15a205c0f5c 100644 --- a/test/e2e/storage/empty_dir_wrapper.go +++ b/test/e2e/storage/empty_dir_wrapper.go @@ -351,7 +351,7 @@ func testNoWrappedVolumeRace(f *framework.Framework, volumes []v1.Volume, volume Containers: []v1.Container{ { Name: "test-container", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sleep", "10000"}, Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ diff --git a/test/e2e/storage/pd.go b/test/e2e/storage/pd.go index bc88a4a2c3b..0fdb21a839c 100644 --- a/test/e2e/storage/pd.go +++ b/test/e2e/storage/pd.go @@ -38,7 +38,6 @@ import ( v1core "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) const ( @@ -486,7 +485,7 @@ func testPDPod(diskNames []string, targetNode types.NodeName, readOnly bool, num if numContainers > 1 { containers[i].Name = fmt.Sprintf("mycontainer%v", i+1) } - containers[i].Image = imageutils.GetBusyBoxImage() + containers[i].Image = "busybox" containers[i].Command = []string{"sleep", "6000"} containers[i].VolumeMounts = make([]v1.VolumeMount, len(diskNames)) for k := range diskNames { diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index 465c4fa4015..093b584efd2 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -45,7 +45,6 @@ import ( storageutil "k8s.io/kubernetes/pkg/apis/storage/v1/util" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) type storageClassTest struct { @@ -796,7 +795,7 @@ func runInPodWithVolume(c clientset.Interface, ns, claimName, command string) { Containers: []v1.Container{ { Name: "volume-tester", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"/bin/sh"}, Args: []string{"-c", command}, VolumeMounts: []v1.VolumeMount{ diff --git a/test/e2e/storage/vsphere_utils.go b/test/e2e/storage/vsphere_utils.go index a0b15ff3432..b615819f59d 100644 --- a/test/e2e/storage/vsphere_utils.go +++ b/test/e2e/storage/vsphere_utils.go @@ -36,7 +36,6 @@ import ( "k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vclib" "k8s.io/kubernetes/pkg/volume/util/volumehelper" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) // Sanity check for vSphere testing. Verify the persistent disk attached to the node. @@ -245,7 +244,7 @@ func getVSpherePodSpecWithClaim(claimName string, nodeSelectorKV map[string]stri Containers: []v1.Container{ { Name: "volume-tester", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"/bin/sh"}, Args: []string{"-c", command}, VolumeMounts: []v1.VolumeMount{ @@ -310,7 +309,7 @@ func getVSpherePodSpecWithVolumePaths(volumePaths []string, keyValuelabel map[st Containers: []v1.Container{ { Name: "vsphere-e2e-container-" + string(uuid.NewUUID()), - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: commands, VolumeMounts: volumeMounts, }, diff --git a/test/e2e/upgrades/configmaps.go b/test/e2e/upgrades/configmaps.go index 476c283c37c..af39c3b1b1f 100644 --- a/test/e2e/upgrades/configmaps.go +++ b/test/e2e/upgrades/configmaps.go @@ -118,7 +118,7 @@ func (t *ConfigMapUpgradeTest) testPod(f *framework.Framework) { }, { Name: "configmap-env-test", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sh", "-c", "env"}, Env: []v1.EnvVar{ { diff --git a/test/e2e/upgrades/secrets.go b/test/e2e/upgrades/secrets.go index 03fe8656378..807c47f6c1a 100644 --- a/test/e2e/upgrades/secrets.go +++ b/test/e2e/upgrades/secrets.go @@ -114,7 +114,7 @@ func (t *SecretUpgradeTest) testPod(f *framework.Framework) { }, { Name: "secret-env-test", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"sh", "-c", "env"}, Env: []v1.EnvVar{ { diff --git a/test/e2e/upgrades/sysctl.go b/test/e2e/upgrades/sysctl.go index 373360c407d..5ef0422ee3f 100644 --- a/test/e2e/upgrades/sysctl.go +++ b/test/e2e/upgrades/sysctl.go @@ -30,7 +30,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/sysctl" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" ) // SecretUpgradeTest tests that a pod with sysctls runs before and after an upgrade. During @@ -132,7 +131,7 @@ func sysctlTestPod(name string, sysctls map[string]string) *v1.Pod { Containers: []v1.Container{ { Name: "test-container", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: append([]string{"/bin/sysctl"}, keys...), }, }, diff --git a/test/e2e_node/docker_test.go b/test/e2e_node/docker_test.go index 6142eba8b20..d8ecc68a1a7 100644 --- a/test/e2e_node/docker_test.go +++ b/test/e2e_node/docker_test.go @@ -24,7 +24,6 @@ import ( "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/kubernetes/test/e2e/framework" - imageutils "k8s.io/kubernetes/test/utils/image" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -55,12 +54,12 @@ var _ = framework.KubeDescribe("Docker features [Feature:Docker]", func() { Containers: []v1.Container{ { Name: "test-container-1", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"/bin/top"}, }, { Name: "test-container-2", - Image: imageutils.GetBusyBoxImage(), + Image: "busybox", Command: []string{"/bin/sleep"}, Args: []string{"10000"}, }, diff --git a/test/e2e_node/security_context_test.go b/test/e2e_node/security_context_test.go index 08b395fc4bd..7e30d167fc9 100644 --- a/test/e2e_node/security_context_test.go +++ b/test/e2e_node/security_context_test.go @@ -341,7 +341,7 @@ var _ = framework.KubeDescribe("Security Context", func() { createAndWaitUserPod := func(readOnlyRootFilesystem bool) string { podName := fmt.Sprintf("busybox-readonly-%v-%s", readOnlyRootFilesystem, uuid.NewUUID()) podClient.Create(makeUserPod(podName, - imageutils.GetBusyBoxImage(), + "busybox", []string{"sh", "-c", "touch checkfile"}, readOnlyRootFilesystem, )) diff --git a/test/e2e_node/util.go b/test/e2e_node/util.go index 3cec9f54dbc..e9fc1a653a8 100644 --- a/test/e2e_node/util.go +++ b/test/e2e_node/util.go @@ -45,7 +45,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - imageutils "k8s.io/kubernetes/test/utils/image" ) // TODO(random-liu): Get this automatically from kubelet flag. @@ -53,7 +52,7 @@ var kubeletAddress = flag.String("kubelet-address", "http://127.0.0.1:10255", "H var startServices = flag.Bool("start-services", true, "If true, start local node services") var stopServices = flag.Bool("stop-services", true, "If true, stop local node services after running tests") -var busyboxImage = imageutils.GetBusyBoxImage() +var busyboxImage = "busybox" func getNodeSummary() (*stats.Summary, error) { req, err := http.NewRequest("GET", *kubeletAddress+"/stats/summary", nil) diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go index dda151abe64..1d03dea5ec1 100644 --- a/test/utils/image/manifest.go +++ b/test/utils/image/manifest.go @@ -86,21 +86,3 @@ var ( func GetE2EImage(image ImageConfig) string { return fmt.Sprintf("%s/%s-%s:%s", image.registry, image.name, runtime.GOARCH, image.version) } - -// GetBusyboxImage returns multi-arch busybox docker image -func GetBusyBoxImage() string { - switch arch := runtime.GOARCH; arch { - case "amd64": - return "busybox" - case "arm": - return "arm32v6/busybox" - case "arm64": - return "arm64v8/busybox" - case "ppc64le": - return "ppc64le/busybox" - case "s390x": - return "s390x/busybox" - default: - return "" - } -}