From 0a7931f5ab478b9060b5bca79c95bf56ff699d0d Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Wed, 7 May 2025 14:44:10 +0200 Subject: [PATCH] qa/tasks/cephadm: override container image tags By default, container image name is tagged by branch name or by sha1, i.e. corresponding values suffixed ':' are appended to the image value. This patch allows to override the tagging just by providing desired tag with the standard notation using ':' separator in the container image parameter value of cephadm task. Fixes: https://tracker.ceph.com/issues/71844 Signed-off-by: Kyr Shatskyy --- qa/tasks/cephadm.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index f64744dabf77f..fdc701223b0eb 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -2304,6 +2304,16 @@ def task(ctx, config): username: registry-user password: registry-password + By default, the image tag is determined as a suite 'branch' value, + or 'sha1' if provided. However, the tag value can be overridden by + including ':TAG' or '@DIGEST' in the container image name, for example, + for the tag 'latest', the 'overrides' section looks like: + + overrides: + cephadm: + containers: + image: 'quay.io/ceph-ci/ceph:latest' + :param ctx: the argparse.Namespace object :param config: the config dict :param watchdog_setup: start DaemonWatchdog to watch daemons for failures @@ -2351,7 +2361,10 @@ def task(ctx, config): sha1 = config.get('sha1') flavor = config.get('flavor', 'default') - if sha1: + if any(_ in container_image_name for _ in (':', '@')): + log.info('Provided image contains tag or digest, using it as is') + ctx.ceph[cluster_name].image = container_image_name + elif sha1: if flavor == "crimson-debug" or flavor == "crimson-release": ctx.ceph[cluster_name].image = container_image_name + ':' + sha1 + '-' + flavor else: -- 2.39.5