Skip to content

Commit 0a7931f

Browse files
author
Kyr Shatskyy
committed
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 <[email protected]>
1 parent 19b19a4 commit 0a7931f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

qa/tasks/cephadm.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,6 +2304,16 @@ def task(ctx, config):
23042304
username: registry-user
23052305
password: registry-password
23062306
2307+
By default, the image tag is determined as a suite 'branch' value,
2308+
or 'sha1' if provided. However, the tag value can be overridden by
2309+
including ':TAG' or '@DIGEST' in the container image name, for example,
2310+
for the tag 'latest', the 'overrides' section looks like:
2311+
2312+
overrides:
2313+
cephadm:
2314+
containers:
2315+
image: 'quay.io/ceph-ci/ceph:latest'
2316+
23072317
:param ctx: the argparse.Namespace object
23082318
:param config: the config dict
23092319
:param watchdog_setup: start DaemonWatchdog to watch daemons for failures
@@ -2351,7 +2361,10 @@ def task(ctx, config):
23512361
sha1 = config.get('sha1')
23522362
flavor = config.get('flavor', 'default')
23532363

2354-
if sha1:
2364+
if any(_ in container_image_name for _ in (':', '@')):
2365+
log.info('Provided image contains tag or digest, using it as is')
2366+
ctx.ceph[cluster_name].image = container_image_name
2367+
elif sha1:
23552368
if flavor == "crimson-debug" or flavor == "crimson-release":
23562369
ctx.ceph[cluster_name].image = container_image_name + ':' + sha1 + '-' + flavor
23572370
else:

0 commit comments

Comments
 (0)