]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: override container image tags 64184/head
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Wed, 7 May 2025 12:44:10 +0000 (14:44 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Wed, 25 Jun 2025 23:17:05 +0000 (01:17 +0200)
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 <kyrylo.shatskyy@clyso.com>
qa/tasks/cephadm.py

index f64744dabf77f34a41e693a338e97196f43856b9..fdc701223b0eb419897dd6f8f14925e39fe7212d 100644 (file)
@@ -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: