Skip to content

Commit c833582

Browse files
committed
feat(scheduler.py): Add image_prefix parameter
On staging we need "staging-" prefix for docker images, before we had this by various kind of hacks, but now we can introduce image_prefix parameter in toml file and f-string parameter in yaml file Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent d87447c commit c833582

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/scheduler.py

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def __init__(self, configs, args):
3131
self._api_config_yaml = yaml.dump(self._api_config)
3232
self._verbose = args.verbose
3333
self._output = args.output
34+
self._imgprefix = args.image_prefix or ''
3435
if not os.path.exists(self._output):
3536
os.makedirs(self._output)
3637
rconfigs = (
@@ -88,6 +89,13 @@ def _run_job(self, job_config, runtime, platform, input_node):
8889
job_node['artifacts'].update(parent_node['artifacts'])
8990
else:
9091
job_node['artifacts'] = parent_node['artifacts']
92+
if job_config.image:
93+
# handle it as f-string, with possible parameter imgprefix
94+
image_params = {
95+
'image_prefix': self._imgprefix
96+
}
97+
imagename = job_config.image.format_map(image_params)
98+
job_config.image = imagename
9199
job = kernelci.runtime.Job(job_node, job_config)
92100
job.platform_config = platform
93101
job.storage_config = self._storage_config

0 commit comments

Comments
 (0)