]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: derive container image from cephadm release 68288/head
authorLumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
Thu, 9 Apr 2026 15:10:33 +0000 (17:10 +0200)
committerLumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
Thu, 9 Apr 2026 15:10:33 +0000 (17:10 +0200)
test_cephadm.sh hardcodes IMAGE_DEFAULT to ceph:main, which breaks
every stable branch whenever main is renamed to a new release. The
mismatch check in cephadm correctly rejects the container because its
release name doesn't match cephadm's own release. This has recurred on
every release transition (squid→tentacle, quincy→reef) without a fix.

Instead of always pulling ceph:main, derive IMAGE_DEFAULT from the
installed cephadm's version output. On stable builds (release type
"stable"), use ceph:<release> so the container matches cephadm. On dev
builds (main branch), fall back to ceph:main as before. The IMAGE_DEFAULT
env var can still be set externally to override.

Fixes: https://tracker.ceph.com/issues/75821
Signed-off-by: Lumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
qa/workunits/cephadm/test_cephadm.sh

index 2866609103f519d32c76078ce03ee3138d9dfe4a..990cbf7c2e202095849c92160144bb94242d5bf9 100755 (executable)
@@ -12,7 +12,6 @@ FSID='00000000-0000-0000-0000-0000deadbeef'
 IMAGE_MAIN=${IMAGE_MAIN:-'quay.ceph.io/ceph-ci/ceph:main'}
 IMAGE_REEF=${IMAGE_REEF:-'quay.ceph.io/ceph-ci/ceph:reef'}
 IMAGE_SQUID=${IMAGE_SQUID:-'quay.ceph.io/ceph-ci/ceph:squid'}
-IMAGE_DEFAULT=${IMAGE_MAIN}
 
 OSD_IMAGE_NAME="${SCRIPT_NAME%.*}_osd.img"
 OSD_IMAGE_SIZE='6G'
@@ -47,6 +46,20 @@ if ! [ -x "$CEPHADM" ]; then
     exit 1
 fi
 
+# Derive IMAGE_DEFAULT from cephadm's own release so that stable branches
+# pull a matching container instead of always using ceph:main.
+# See https://tracker.ceph.com/issues/75821
+if [ -z "$IMAGE_DEFAULT" ]; then
+    _ver=$("$CEPHADM" version 2>/dev/null || true)
+    _release=$(echo "$_ver" | awk '{print $5}')
+    _type=$(echo "$_ver" | awk '{gsub(/[()]/, "", $6); print $6}')
+    if [ -n "$_release" ] && [ "$_type" != "dev" ]; then
+        IMAGE_DEFAULT="quay.ceph.io/ceph-ci/ceph:${_release}"
+    else
+        IMAGE_DEFAULT=${IMAGE_MAIN}
+    fi
+fi
+
 # add image to args
 CEPHADM_ARGS="$CEPHADM_ARGS --image $IMAGE_DEFAULT"