From 3c8822133ac5ef80c5847ad07a5072ddce9bb8d9 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Mon, 16 Sep 2019 05:52:33 -0700 Subject: [PATCH] tests: Simplifies image pulling tests Melds the "pull image from gcr.io" and "pull image from docker hub" tests into a single test that pulls the agnhost image from the configured e2eRegistry. This also removes the need to maintain and update the image "gcr.io/kubernetes-e2e-test-images/windows-nanoserver:v1". It should have been a manifest list that also includes future Windows releases, like Windows Server 1903. Additionally, the image has ~300 MB, meaning that with this change, it won't have to wait as much to spawn a pod. Removes "should not be able to pull non-existing image from gcr.io", since the test "should not be able to pull image from invalid registry" test already exists, and both of them test the same effect: cannot spawn a pod with an image that does not exist. --- test/e2e/common/runtime.go | 28 ++++------------------------ test/utils/image/manifest.go | 12 ------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/test/e2e/common/runtime.go b/test/e2e/common/runtime.go index 68074628c2f..32aa7d1011c 100644 --- a/test/e2e/common/runtime.go +++ b/test/e2e/common/runtime.go @@ -359,30 +359,10 @@ while true; do sleep 1; done imagePullTest(image, false, v1.PodPending, true, false) }) - ginkgo.It("should not be able to pull non-existing image from gcr.io [NodeConformance]", func() { - image := imageutils.GetE2EImage(imageutils.Invalid) - imagePullTest(image, false, v1.PodPending, true, false) - }) - - ginkgo.It("should be able to pull image from gcr.io [NodeConformance]", func() { - image := imageutils.GetE2EImage(imageutils.DebianBase) - isWindows := false - if framework.NodeOSDistroIs("windows") { - image = imageutils.GetE2EImage(imageutils.WindowsNanoServer) - isWindows = true - } - imagePullTest(image, false, v1.PodRunning, false, isWindows) - }) - - ginkgo.It("should be able to pull image from docker hub [NodeConformance]", func() { - image := imageutils.GetE2EImage(imageutils.Alpine) - isWindows := false - if framework.NodeOSDistroIs("windows") { - // TODO(claudiub): Switch to nanoserver image manifest list. - image = "e2eteam/busybox:1.29" - isWindows = true - } - imagePullTest(image, false, v1.PodRunning, false, isWindows) + ginkgo.It("should be able to pull image [NodeConformance]", func() { + // NOTE(claudiub): The agnhost image is supposed to work on both Linux and Windows. + image := imageutils.GetE2EImage(imageutils.Agnhost) + imagePullTest(image, false, v1.PodRunning, false, false) }) ginkgo.It("should not be able to pull from private registry without secret [NodeConformance]", func() { diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go index 5426b69e900..0706a1049a2 100644 --- a/test/utils/image/manifest.go +++ b/test/utils/image/manifest.go @@ -118,8 +118,6 @@ var ( const ( // Agnhost image Agnhost = iota - // Alpine image - Alpine // APIServer image APIServer // AppArmorLoader image @@ -138,8 +136,6 @@ const ( CudaVectorAdd2 // Dnsutils image Dnsutils - // DebianBase image - DebianBase // EchoServer image EchoServer // Etcd image @@ -152,8 +148,6 @@ const ( Httpd // HttpdNew image HttpdNew - // Invalid image - Invalid // InvalidRegistryImage image InvalidRegistryImage // IpcUtils image @@ -209,14 +203,11 @@ const ( VolumeGlusterServer // VolumeRBDServer image VolumeRBDServer - // WindowsNanoServer image - WindowsNanoServer ) func initImageConfigs() map[int]Config { configs := map[int]Config{} configs[Agnhost] = Config{e2eRegistry, "agnhost", "2.6"} - configs[Alpine] = Config{dockerLibraryRegistry, "alpine", "3.7"} configs[AuthenticatedAlpine] = Config{gcAuthenticatedRegistry, "alpine", "3.7"} configs[AuthenticatedWindowsNanoServer] = Config{gcAuthenticatedRegistry, "windows-nanoserver", "v1"} configs[APIServer] = Config{e2eRegistry, "sample-apiserver", "1.10"} @@ -226,14 +217,12 @@ func initImageConfigs() map[int]Config { configs[CudaVectorAdd] = Config{e2eRegistry, "cuda-vector-add", "1.0"} configs[CudaVectorAdd2] = Config{e2eRegistry, "cuda-vector-add", "2.0"} configs[Dnsutils] = Config{e2eRegistry, "dnsutils", "1.1"} - configs[DebianBase] = Config{googleContainerRegistry, "debian-base", "0.4.1"} configs[EchoServer] = Config{e2eRegistry, "echoserver", "2.2"} configs[Etcd] = Config{gcRegistry, "etcd", "3.3.15"} configs[GBFrontend] = Config{sampleRegistry, "gb-frontend", "v6"} configs[GlusterDynamicProvisioner] = Config{dockerGluster, "glusterdynamic-provisioner", "v1.0"} configs[Httpd] = Config{dockerLibraryRegistry, "httpd", "2.4.38-alpine"} configs[HttpdNew] = Config{dockerLibraryRegistry, "httpd", "2.4.39-alpine"} - configs[Invalid] = Config{gcRegistry, "invalid-image", "invalid-tag"} configs[InvalidRegistryImage] = Config{invalidRegistry, "alpine", "3.1"} configs[IpcUtils] = Config{e2eRegistry, "ipc-utils", "1.0"} configs[JessieDnsutils] = Config{e2eRegistry, "jessie-dnsutils", "1.0"} @@ -262,7 +251,6 @@ func initImageConfigs() map[int]Config { configs[VolumeISCSIServer] = Config{e2eRegistry, "volume/iscsi", "2.0"} configs[VolumeGlusterServer] = Config{e2eRegistry, "volume/gluster", "1.0"} configs[VolumeRBDServer] = Config{e2eRegistry, "volume/rbd", "1.0.1"} - configs[WindowsNanoServer] = Config{e2eRegistry, "windows-nanoserver", "v1"} return configs }