From: Lumir Sliva <61183145+lumir-sliva@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:10:33 +0000 (+0200) Subject: qa/cephadm: derive container image from cephadm release X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db3ba638e9fe04d8718c33668eeffd98d705944e;p=ceph.git qa/cephadm: derive container image from cephadm release 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: 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> --- diff --git a/qa/workunits/cephadm/test_cephadm.sh b/qa/workunits/cephadm/test_cephadm.sh index 2866609103f5..990cbf7c2e20 100755 --- a/qa/workunits/cephadm/test_cephadm.sh +++ b/qa/workunits/cephadm/test_cephadm.sh @@ -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"