From a1b9f594d4ff16348fa2ee0fa5eb30a5f92240ed Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Fri, 14 Jun 2024 17:06:42 -0700 Subject: [PATCH] Use ECR Mirror for Curl Test Image. --- test/framework/resources/agent/traffic_tester.go | 2 +- test/framework/resources/k8s/manifest/container.go | 4 ++-- test/framework/utils/const.go | 1 + test/integration/cni-egress/pod_egress_test.go | 4 ++-- test/integration/cni/pod_traffic_across_az_test.go | 2 +- test/integration/ipamd/introspection_test.go | 2 +- test/integration/ipamd/metrics_test.go | 2 +- test/integration/pod-eni/security_group_per_pod_test.go | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/framework/resources/agent/traffic_tester.go b/test/framework/resources/agent/traffic_tester.go index b01d56acec..0cb44e9956 100644 --- a/test/framework/resources/agent/traffic_tester.go +++ b/test/framework/resources/agent/traffic_tester.go @@ -227,7 +227,7 @@ func (t *TrafficTest) startMetricServerPod() (*v1.Pod, error) { } func (t *TrafficTest) getTestStatusFromMetricServer(metricPodIP string) ([]input.TestStatus, error) { - getMetricContainer := manifest.NewCurlContainer(). + getMetricContainer := manifest.NewCurlContainer(t.Framework.Options.TestImageRegistry). Name("get-metric-container"). Command([]string{"curl"}). Args([]string{fmt.Sprintf("http://%s:8080/get/metric/connectivity", metricPodIP), "--silent"}). diff --git a/test/framework/resources/k8s/manifest/container.go b/test/framework/resources/k8s/manifest/container.go index 4afdb6d295..0a1c1164be 100644 --- a/test/framework/resources/k8s/manifest/container.go +++ b/test/framework/resources/k8s/manifest/container.go @@ -41,10 +41,10 @@ func NewBusyBoxContainerBuilder(testImageRegistry string) *Container { } } -func NewCurlContainer() *Container { +func NewCurlContainer(testImageRegistry string) *Container { return &Container{ name: "curl", - image: "curlimages/curl:latest", + image: utils.GetTestImage(testImageRegistry, utils.CurlImage), imagePullPolicy: v1.PullIfNotPresent, } } diff --git a/test/framework/utils/const.go b/test/framework/utils/const.go index 3a96cb4e1c..b7d0a769ae 100644 --- a/test/framework/utils/const.go +++ b/test/framework/utils/const.go @@ -28,6 +28,7 @@ const ( BusyBoxImage = "networking-e2e-test-images/busybox:latest" NginxImage = "networking-e2e-test-images/nginx:1.25.2" NetCatImage = "networking-e2e-test-images/netcat-openbsd:v1.0" + CurlImage = "networking-e2e-test-images/curlimages/curl:latest" PollIntervalShort = time.Second * 2 PollIntervalMedium = time.Second * 5 diff --git a/test/integration/cni-egress/pod_egress_test.go b/test/integration/cni-egress/pod_egress_test.go index 1b116aeda1..c1766677f7 100644 --- a/test/integration/cni-egress/pod_egress_test.go +++ b/test/integration/cni-egress/pod_egress_test.go @@ -53,8 +53,8 @@ var _ = Describe("[CANARY] test cluster egress connectivity", func() { // initialize vars err = nil - // initialize busybox container for testing later - testerContainer = manifest.NewCurlContainer(). + // initialize curl container for testing later + testerContainer = manifest.NewCurlContainer(f.Options.TestImageRegistry). Command([]string{"sleep", "3600"}).Build() testerContainer.SecurityContext = &coreV1.SecurityContext{ diff --git a/test/integration/cni/pod_traffic_across_az_test.go b/test/integration/cni/pod_traffic_across_az_test.go index 841f99c027..fc22cf3544 100644 --- a/test/integration/cni/pod_traffic_across_az_test.go +++ b/test/integration/cni/pod_traffic_across_az_test.go @@ -230,7 +230,7 @@ var _ = Describe("[STATIC_CANARY] API Server Connectivity from AZs", FlakeAttemp JustBeforeEach(func() { serverContainer := manifest. - NewCurlContainer(). + NewCurlContainer(f.Options.TestImageRegistry). Command([]string{ "sleep", "3600", diff --git a/test/integration/ipamd/introspection_test.go b/test/integration/ipamd/introspection_test.go index 178ee6b899..289c72febc 100644 --- a/test/integration/ipamd/introspection_test.go +++ b/test/integration/ipamd/introspection_test.go @@ -36,7 +36,7 @@ var _ = Describe("test Environment Variables for IPAMD Introspection ", func() { JustBeforeEach(func() { // Initially the host networking job pod should succeed - curlContainer = manifest.NewCurlContainer(). + curlContainer = manifest.NewCurlContainer(f.Options.TestImageRegistry). Command([]string{"curl"}). Args([]string{"--fail", defaultIntrospectionAddr}). Build() diff --git a/test/integration/ipamd/metrics_test.go b/test/integration/ipamd/metrics_test.go index d967374956..3db2ef230d 100644 --- a/test/integration/ipamd/metrics_test.go +++ b/test/integration/ipamd/metrics_test.go @@ -35,7 +35,7 @@ var _ = Describe("test IPAMD metric environment variable", func() { Context("when metrics is disabled", func() { metricAddr := "127.0.0.1:61678/metrics" It("should not be accessible anymore", func() { - curlContainer = manifest.NewCurlContainer(). + curlContainer = manifest.NewCurlContainer(f.Options.TestImageRegistry). Command([]string{"curl"}). Args([]string{"--fail", metricAddr}). Build() diff --git a/test/integration/pod-eni/security_group_per_pod_test.go b/test/integration/pod-eni/security_group_per_pod_test.go index fddbab87a7..8c92e8a6b5 100644 --- a/test/integration/pod-eni/security_group_per_pod_test.go +++ b/test/integration/pod-eni/security_group_per_pod_test.go @@ -230,7 +230,7 @@ var _ = Describe("Security Group for Pods Test", func() { ContainerPort: 80, } - container := manifest.NewCurlContainer(). + container := manifest.NewCurlContainer(f.Options.TestImageRegistry). LivenessProbe(tcpProbe). Image("nginx"). Port(port).