From e06402866b89e887abc84fd4bf51afaa03e51b6d Mon Sep 17 00:00:00 2001 From: ArkaSaha30 Date: Fri, 17 Mar 2023 10:19:49 +0530 Subject: [PATCH] Migrate image registry to registry.k8s.io Signed-off-by: ArkaSaha30 --- ci/conformance-image-config.yaml | 2 +- ci/jenkins/test.sh | 12 ++++++------ ci/kind/test-e2e-kind.sh | 4 ++-- hack/netpol-generator/test-kind.sh | 4 ++-- hack/netpol/pkg/utils/k8s_util.go | 5 +++-- pkg/apiserver/openapi/zz_generated.openapi.go | 2 +- test/e2e/framework.go | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ci/conformance-image-config.yaml b/ci/conformance-image-config.yaml index 845c4e82e29..5b0cc6a9598 100644 --- a/ci/conformance-image-config.yaml +++ b/ci/conformance-image-config.yaml @@ -1 +1 @@ -dockerLibraryRegistry: k8s.gcr.io/e2e-test-images +dockerLibraryRegistry: registry.k8s.io/e2e-test-images diff --git a/ci/jenkins/test.sh b/ci/jenkins/test.sh index 2ab51976090..1e40c0699f9 100755 --- a/ci/jenkins/test.sh +++ b/ci/jenkins/test.sh @@ -368,7 +368,7 @@ function deliver_antrea_windows { echo "===== Pull necessary images on Control-Plane node =====" harbor_images=("agnhost:2.13" "nginx:1.15-alpine") antrea_images=("e2eteam/agnhost:2.13" "docker.io/library/nginx:1.15-alpine") - common_images=("k8s.gcr.io/e2e-test-images/agnhost:2.29") + common_images=("registry.k8s.io/e2e-test-images/agnhost:2.29") for i in "${!harbor_images[@]}"; do docker pull -q "${DOCKER_REGISTRY}/antrea/${harbor_images[i]}" docker tag "${DOCKER_REGISTRY}/antrea/${harbor_images[i]}" "${antrea_images[i]}" @@ -395,7 +395,7 @@ function deliver_antrea_windows { # Some tests need us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13 image but it is not for windows/amd64 10.0.17763 # Use e2eteam/agnhost:2.13 instead harbor_images=("sigwindowstools-kube-proxy:v1.18.0" "agnhost:2.13" "agnhost:2.13" "agnhost:2.13" "agnhost:2.29" "e2eteam-jessie-dnsutils:1.0" "e2eteam-jessie-dnsutils:1.0" "e2eteam-pause:3.2" "e2eteam-pause:3.2" "e2eteam-busybox:1.29-windows-amd64-1809") - antrea_images=("sigwindowstools/kube-proxy:v1.18.0" "e2eteam/agnhost:2.13" "us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13" "k8sprow.azurecr.io/kubernetes-e2e-test-images/agnhost:2.13" "k8s.gcr.io/e2e-test-images/agnhost:2.29" "e2eteam/jessie-dnsutils:1.0" "gcr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.0" "e2eteam/pause:3.2" "k8s.gcr.io/pause:3.2" "docker.io/library/busybox:1.29") + antrea_images=("sigwindowstools/kube-proxy:v1.18.0" "e2eteam/agnhost:2.13" "us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13" "k8sprow.azurecr.io/kubernetes-e2e-test-images/agnhost:2.13" "registry.k8s.io/e2e-test-images/agnhost:2.29" "e2eteam/jessie-dnsutils:1.0" "gcr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.0" "e2eteam/pause:3.2" "registry.k8s.io/pause:3.2" "docker.io/library/busybox:1.29") common_images=("mcr.microsoft.com/windows/servercore/iis:latest") # Pull necessary images in advance to avoid transient error for i in "${!harbor_images[@]}"; do @@ -479,8 +479,8 @@ function deliver_antrea_windows_containerd { echo "===== Pull necessary images on Control-Plane node =====" harbor_images=("agnhost:2.13" "nginx:1.15-alpine") antrea_images=("e2eteam/agnhost:2.13" "docker.io/library/nginx:1.15-alpine") - common_images=("k8s.gcr.io/e2e-test-images/agnhost:2.29") - k8s_images=("k8s.gcr.io/e2e-test-images/agnhost:2.40" "k8s.gcr.io/e2e-test-images/jessie-dnsutils:1.5" "k8s.gcr.io/e2e-test-images/nginx:1.14-2") + common_images=("registry.k8s.io/e2e-test-images/agnhost:2.29") + k8s_images=("registry.k8s.io/e2e-test-images/agnhost:2.40" "registry.k8s.io/e2e-test-images/jessie-dnsutils:1.5" "registry.k8s.io/e2e-test-images/nginx:1.14-2") e2e_images=("k8sprow.azurecr.io/kubernetes-e2e-test-images/agnhost:2.40" "k8sprow.azurecr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.5" "k8sprow.azurecr.io/kubernetes-e2e-test-images/nginx:1.14-2") for i in "${!harbor_images[@]}"; do @@ -529,8 +529,8 @@ function deliver_antrea_windows_containerd { # Some tests need us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13 image but it is not for windows/amd64 10.0.17763 # Use e2eteam/agnhost:2.13 instead harbor_images=("sigwindowstools-kube-proxy:v1.18.0" "agnhost:2.13" "agnhost:2.13" "agnhost:2.29" "e2eteam-jessie-dnsutils:1.0" "e2eteam-pause:3.2") - antrea_images=("sigwindowstools/kube-proxy:v1.18.0" "e2eteam/agnhost:2.13" "us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13" "k8s.gcr.io/e2e-test-images/agnhost:2.29" "e2eteam/jessie-dnsutils:1.0" "e2eteam/pause:3.2") - k8s_images=("k8s.gcr.io/e2e-test-images/agnhost:2.40" "k8s.gcr.io/e2e-test-images/jessie-dnsutils:1.5" "k8s.gcr.io/e2e-test-images/nginx:1.14-2") + antrea_images=("sigwindowstools/kube-proxy:v1.18.0" "e2eteam/agnhost:2.13" "us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnhost:2.13" "registry.k8s.io/e2e-test-images/agnhost:2.29" "e2eteam/jessie-dnsutils:1.0" "e2eteam/pause:3.2") + k8s_images=("registry.k8s.io/e2e-test-images/agnhost:2.40" "registry.k8s.io/e2e-test-images/jessie-dnsutils:1.5" "registry.k8s.io/e2e-test-images/nginx:1.14-2") e2e_images=("k8sprow.azurecr.io/kubernetes-e2e-test-images/agnhost:2.40" "k8sprow.azurecr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.5" "k8sprow.azurecr.io/kubernetes-e2e-test-images/nginx:1.14-2") # Pull necessary images in advance to avoid transient error for i in "${!harbor_images[@]}"; do diff --git a/ci/kind/test-e2e-kind.sh b/ci/kind/test-e2e-kind.sh index 1ada717ba41..c8ba962cba4 100755 --- a/ci/kind/test-e2e-kind.sh +++ b/ci/kind/test-e2e-kind.sh @@ -147,7 +147,7 @@ if $flow_visibility; then manifest_args="$manifest_args --feature-gates FlowExporter=true --extra-helm-values-file $FLOW_VISIBILITY_HELM_VALUES" fi -COMMON_IMAGES_LIST=("k8s.gcr.io/e2e-test-images/agnhost:2.29" \ +COMMON_IMAGES_LIST=("registry.k8s.io/e2e-test-images/agnhost:2.29" \ "projects.registry.vmware.com/antrea/busybox" \ "projects.registry.vmware.com/antrea/nginx:1.21.6-alpine" \ "projects.registry.vmware.com/antrea/perftool") @@ -163,7 +163,7 @@ else COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu:latest") fi if $proxy_all; then - COMMON_IMAGES_LIST+=("k8s.gcr.io/echoserver:1.10") + COMMON_IMAGES_LIST+=("registry.k8s.io/echoserver:1.10") fi if $flow_visibility; then COMMON_IMAGES_LIST+=("${FLOW_VISIBILITY_IMAGE_LIST[@]}") diff --git a/hack/netpol-generator/test-kind.sh b/hack/netpol-generator/test-kind.sh index ddf23c8a994..16056e325ff 100755 --- a/hack/netpol-generator/test-kind.sh +++ b/hack/netpol-generator/test-kind.sh @@ -33,8 +33,8 @@ kind load docker-image antrea/antrea-ubuntu:latest docker pull mfenwick100/cyclonus:v0.4.7 kind load docker-image mfenwick100/cyclonus:v0.4.7 # pre-load agnhost image -docker pull k8s.gcr.io/e2e-test-images/agnhost:2.29 -kind load docker-image k8s.gcr.io/e2e-test-images/agnhost:2.29 +docker pull registry.k8s.io/e2e-test-images/agnhost:2.29 +kind load docker-image registry.k8s.io/e2e-test-images/agnhost:2.29 "$ROOT_DIR"/hack/generate-manifest.sh | kubectl apply -f - diff --git a/hack/netpol/pkg/utils/k8s_util.go b/hack/netpol/pkg/utils/k8s_util.go index 1e071398130..85c3c3ebd51 100644 --- a/hack/netpol/pkg/utils/k8s_util.go +++ b/hack/netpol/pkg/utils/k8s_util.go @@ -17,11 +17,12 @@ package utils import ( "bytes" "fmt" - "k8s.io/client-go/rest" "os" "path/filepath" "strings" + "k8s.io/client-go/rest" + "github.com/pkg/errors" log "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" @@ -219,7 +220,7 @@ func (k *Kubernetes) CreateOrUpdateDeployment(ns, deploymentName string, replica return v1.Container{ Name: fmt.Sprintf("c%d", port), ImagePullPolicy: v1.PullIfNotPresent, - Image: "k8s.gcr.io/e2e-test-images/agnhost:2.29", + Image: "registry.k8s.io/e2e-test-images/agnhost:2.29", // "-k" for persistent server Command: []string{"/agnhost", "serve-hostname", "--tcp", "--http=false", "--port", fmt.Sprintf("%d", port)}, SecurityContext: &v1.SecurityContext{}, diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index 2661ea4ba76..6b3095b08e3 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -4855,7 +4855,7 @@ func schema_k8sio_api_core_v1_ContainerImage(ref common.ReferenceCallback) commo Properties: map[string]spec.Schema{ "names": { SchemaProps: spec.SchemaProps{ - Description: "Names by which this image is known. e.g. [\"k8s.gcr.io/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", + Description: "Names by which this image is known. e.g. [\"registry.k8s.io/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ diff --git a/test/e2e/framework.go b/test/e2e/framework.go index c73be67cdcb..38eff2d6847 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -119,7 +119,7 @@ const ( nameSuffixLength int = 8 - agnhostImage = "k8s.gcr.io/e2e-test-images/agnhost:2.29" + agnhostImage = "registry.k8s.io/e2e-test-images/agnhost:2.29" busyboxImage = "projects.registry.vmware.com/antrea/busybox" mcjoinImage = "projects.registry.vmware.com/antrea/mcjoin:v2.9" netshootImage = "projects.registry.vmware.com/antrea/netshoot:v0.1"