Skip to content

Commit

Permalink
build: generate the local build tag with docker io
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
travisn committed Aug 20, 2024
1 parent 4c2a341 commit 3045076
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/framework/installer/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ceph_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions tests/scripts/github-action-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 3045076

Please sign in to comment.