From 8b60c52f31bbfabf5ff687421f53e9b112fa9015 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Tue, 20 Aug 2024 14:26:56 -0600 Subject: [PATCH] build: generate the local build tag with docker io The docker.io image prefix is expected to be prepended to the image names in the test images. This was missed in 14550 related to some CI tests, which was now causing the CI failures in the 1.15 branch where the search and replace was missing the new docker.io prefix. Signed-off-by: Travis Nielsen (cherry picked from commit 3045076db8eeda24300ac3192e241fdf162671c3) --- tests/framework/installer/settings.go | 4 ++-- tests/integration/ceph_upgrade_test.go | 2 +- tests/scripts/github-action-helper.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/framework/installer/settings.go b/tests/framework/installer/settings.go index 7cea682b0..145db3b77 100644 --- a/tests/framework/installer/settings.go +++ b/tests/framework/installer/settings.go @@ -26,7 +26,7 @@ import ( "github.com/rook/rook/tests/framework/utils" ) -var imageMatch = regexp.MustCompile(`image: rook\/ceph:[a-z0-9.-]+`) +var imageMatch = regexp.MustCompile(`image: docker.io/rook\/ceph:[a-z0-9.-]+`) func readManifest(filename string) string { rootDir, err := utils.FindRookRoot() @@ -39,7 +39,7 @@ func readManifest(filename string) string { if err != nil { panic(errors.Wrapf(err, "failed to read manifest at %s", manifest)) } - return imageMatch.ReplaceAllString(string(contents), "image: rook/ceph:"+LocalBuildTag) + return imageMatch.ReplaceAllString(string(contents), "image: docker.io/rook/ceph:"+LocalBuildTag) } func buildURL(rookVersion, filename string) string { diff --git a/tests/integration/ceph_upgrade_test.go b/tests/integration/ceph_upgrade_test.go index e7dcb1c0f..a31184e95 100644 --- a/tests/integration/ceph_upgrade_test.go +++ b/tests/integration/ceph_upgrade_test.go @@ -380,7 +380,7 @@ func (s *UpgradeSuite) verifyOperatorImage(expectedImage string) { // verify that the operator spec is updated version, err := k8sutil.GetDeploymentImage(context.TODO(), s.k8sh.Clientset, systemNamespace, operatorContainer, operatorContainer) assert.NoError(s.T(), err) - assert.Contains(s.T(), version, "rook/ceph:"+expectedImage) + assert.Contains(s.T(), "docker.io/rook/ceph:"+expectedImage, version) } func (s *UpgradeSuite) verifyRookUpgrade(numOSDs int) { diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 6159d09d4..cd10c8bb1 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -204,7 +204,7 @@ function build_rook() { tests/scripts/validate_modified_files.sh build docker images if [[ "$build_type" == "build" ]]; then - docker tag "$(docker images | awk '/build-/ {print $1}')" rook/ceph:local-build + docker tag "$(docker images | awk '/build-/ {print $1}')" docker.io/rook/ceph:local-build fi } @@ -246,7 +246,7 @@ function create_cluster_prerequisites() { function deploy_manifest_with_local_build() { sed -i 's/.*ROOK_CSI_ENABLE_NFS:.*/ ROOK_CSI_ENABLE_NFS: \"true\"/g' $1 if [[ "$USE_LOCAL_BUILD" != "false" ]]; then - sed -i "s|image: rook/ceph:.*|image: rook/ceph:local-build|g" $1 + sed -i "s|image: docker.io/rook/ceph:.*|image: docker.io/rook/ceph:local-build|g" $1 fi if [[ "$ALLOW_LOOP_DEVICES" = "true" ]]; then sed -i "s|ROOK_CEPH_ALLOW_LOOP_DEVICES: \"false\"|ROOK_CEPH_ALLOW_LOOP_DEVICES: \"true\"|g" $1 @@ -640,7 +640,7 @@ function test_multus_connections() { function create_operator_toolbox() { cd deploy/examples - sed -i "s|image: rook/ceph:.*|image: rook/ceph:local-build|g" toolbox-operator-image.yaml + sed -i "s|image: docker.io/rook/ceph:.*|image: docker.io/rook/ceph:local-build|g" toolbox-operator-image.yaml kubectl create -f toolbox-operator-image.yaml }