Skip to content

Commit 1b71b2a

Browse files
committed
tests: Replaces mounttest images used with agnhost (part 4)
Quite a few images are only used a few times in a few tests. Thus, the images are being centralized into the agnhost image, reducing the number of images that have to be pulled and used. This PR replaces the usage of the following images with agnhost: - mounttest - mounttest-user Additionally, removes the usage of the mounttest-user image and removes it from kubernetes/test/images. RunAsUser is set instead of having that image.
1 parent 0ad60b3 commit 1b71b2a

15 files changed

+197
-167
lines changed

test/e2e/auth/service_accounts.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ import (
4040
"github.com/onsi/ginkgo"
4141
)
4242

43-
var mountImage = imageutils.GetE2EImage(imageutils.Mounttest)
44-
4543
var _ = SIGDescribe("ServiceAccounts", func() {
4644
f := framework.NewDefaultFramework("svcaccounts")
4745

@@ -388,7 +386,7 @@ var _ = SIGDescribe("ServiceAccounts", func() {
388386
pod := &v1.Pod{
389387
ObjectMeta: metav1.ObjectMeta{Name: tc.PodName},
390388
Spec: v1.PodSpec{
391-
Containers: []v1.Container{{Name: "token-test", Image: mountImage}},
389+
Containers: []v1.Container{{Name: "token-test", Image: imageutils.GetE2EImage(imageutils.Agnhost)}},
392390
RestartPolicy: v1.RestartPolicyNever,
393391
ServiceAccountName: tc.ServiceAccountName,
394392
AutomountServiceAccountToken: tc.AutomountPodSpec,

test/e2e/common/configmap_volume.go

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
162162
},
163163
Containers: []v1.Container{
164164
{
165-
Name: containerName,
166-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
167-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volume/data-1"},
165+
Name: containerName,
166+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
167+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volume/data-1"},
168168
VolumeMounts: []v1.VolumeMount{
169169
{
170170
Name: volumeName,
@@ -249,9 +249,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
249249
},
250250
Containers: []v1.Container{
251251
{
252-
Name: containerName1,
253-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
254-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volume/data-1"},
252+
Name: containerName1,
253+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
254+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volume/data-1"},
255255
VolumeMounts: []v1.VolumeMount{
256256
{
257257
Name: volumeName,
@@ -395,9 +395,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
395395
},
396396
Containers: []v1.Container{
397397
{
398-
Name: deleteContainerName,
399-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
400-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/delete/data-1"},
398+
Name: deleteContainerName,
399+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
400+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/delete/data-1"},
401401
VolumeMounts: []v1.VolumeMount{
402402
{
403403
Name: deleteVolumeName,
@@ -407,9 +407,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
407407
},
408408
},
409409
{
410-
Name: updateContainerName,
411-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
412-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/update/data-3"},
410+
Name: updateContainerName,
411+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
412+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/update/data-3"},
413413
VolumeMounts: []v1.VolumeMount{
414414
{
415415
Name: updateVolumeName,
@@ -419,9 +419,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
419419
},
420420
},
421421
{
422-
Name: createContainerName,
423-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
424-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
422+
Name: createContainerName,
423+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
424+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
425425
VolumeMounts: []v1.VolumeMount{
426426
{
427427
Name: createVolumeName,
@@ -526,8 +526,8 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
526526
Containers: []v1.Container{
527527
{
528528
Name: "configmap-volume-test",
529-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
530-
Args: []string{"--file_content=/etc/configmap-volume/data-1"},
529+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
530+
Args: []string{"mounttest", "--file_content=/etc/configmap-volume/data-1"},
531531
VolumeMounts: []v1.VolumeMount{
532532
{
533533
Name: volumeName,
@@ -671,8 +671,9 @@ func doConfigMapE2EWithoutMappings(f *framework.Framework, asUser bool, fsGroup
671671
Containers: []v1.Container{
672672
{
673673
Name: "configmap-volume-test",
674-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
674+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
675675
Args: []string{
676+
"mounttest",
676677
"--file_content=/etc/configmap-volume/data-1",
677678
"--file_mode=/etc/configmap-volume/data-1"},
678679
VolumeMounts: []v1.VolumeMount{
@@ -753,8 +754,10 @@ func doConfigMapE2EWithMappings(f *framework.Framework, asUser bool, fsGroup int
753754
Containers: []v1.Container{
754755
{
755756
Name: "configmap-volume-test",
756-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
757-
Args: []string{"--file_content=/etc/configmap-volume/path/to/data-2",
757+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
758+
Args: []string{
759+
"mounttest",
760+
"--file_content=/etc/configmap-volume/path/to/data-2",
758761
"--file_mode=/etc/configmap-volume/path/to/data-2"},
759762
VolumeMounts: []v1.VolumeMount{
760763
{
@@ -824,9 +827,9 @@ func createNonOptionalConfigMapPod(f *framework.Framework, volumeMountPath, podN
824827
},
825828
Containers: []v1.Container{
826829
{
827-
Name: createContainerName,
828-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
829-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
830+
Name: createContainerName,
831+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
832+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
830833
VolumeMounts: []v1.VolumeMount{
831834
{
832835
Name: createVolumeName,
@@ -886,9 +889,9 @@ func createNonOptionalConfigMapPodWithConfig(f *framework.Framework, volumeMount
886889
},
887890
Containers: []v1.Container{
888891
{
889-
Name: createContainerName,
890-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
891-
Command: []string{"/mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
892+
Name: createContainerName,
893+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
894+
Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/configmap-volumes/create/data-1"},
892895
VolumeMounts: []v1.VolumeMount{
893896
{
894897
Name: createVolumeName,

test/e2e/common/downwardapi_volume.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ func downwardAPIVolumePodForModeTest(name, filePath string, itemMode, defaultMod
273273

274274
pod.Spec.Containers = []v1.Container{
275275
{
276-
Name: "client-container",
277-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
278-
Command: []string{"/mounttest", "--file_mode=" + filePath},
276+
Name: "client-container",
277+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
278+
Args: []string{"mounttest", "--file_mode=" + filePath},
279279
VolumeMounts: []v1.VolumeMount{
280280
{
281281
Name: "podinfo",
@@ -299,9 +299,9 @@ func downwardAPIVolumePodForSimpleTest(name string, filePath string) *v1.Pod {
299299

300300
pod.Spec.Containers = []v1.Container{
301301
{
302-
Name: "client-container",
303-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
304-
Command: []string{"/mounttest", "--file_content=" + filePath},
302+
Name: "client-container",
303+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
304+
Args: []string{"mounttest", "--file_content=" + filePath},
305305
VolumeMounts: []v1.VolumeMount{
306306
{
307307
Name: "podinfo",
@@ -330,9 +330,9 @@ func downwardAPIVolumeForDefaultContainerResources(name string, filePath string)
330330
func downwardAPIVolumeBaseContainers(name, filePath string) []v1.Container {
331331
return []v1.Container{
332332
{
333-
Name: name,
334-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
335-
Command: []string{"/mounttest", "--file_content=" + filePath},
333+
Name: name,
334+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
335+
Args: []string{"mounttest", "--file_content=" + filePath},
336336
Resources: v1.ResourceRequirements{
337337
Requests: v1.ResourceList{
338338
v1.ResourceCPU: resource.MustParse("250m"),
@@ -358,9 +358,9 @@ func downwardAPIVolumeBaseContainers(name, filePath string) []v1.Container {
358358
func downwardAPIVolumeDefaultBaseContainer(name, filePath string) []v1.Container {
359359
return []v1.Container{
360360
{
361-
Name: name,
362-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
363-
Command: []string{"/mounttest", "--file_content=" + filePath},
361+
Name: name,
362+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
363+
Args: []string{"mounttest", "--file_content=" + filePath},
364364
VolumeMounts: []v1.VolumeMount{
365365
{
366366
Name: "podinfo",
@@ -377,9 +377,9 @@ func downwardAPIVolumePodForUpdateTest(name string, labels, annotations map[stri
377377

378378
pod.Spec.Containers = []v1.Container{
379379
{
380-
Name: "client-container",
381-
Image: imageutils.GetE2EImage(imageutils.Mounttest),
382-
Command: []string{"/mounttest", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=" + filePath},
380+
Name: "client-container",
381+
Image: imageutils.GetE2EImage(imageutils.Agnhost),
382+
Args: []string{"mounttest", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=" + filePath},
383383
VolumeMounts: []v1.VolumeMount{
384384
{
385385
Name: "podinfo",

0 commit comments

Comments
 (0)