From 7bf706bc9a51dadad19ac9242bb820ed33761e52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 15 Nov 2024 17:54:56 +0100 Subject: [PATCH] CI: harmonize pull/clean with flexric hack If we are pulling FlexRIC, overwrite the tag to use with what has been provided on the command line. This is because we hardcode the tag schema "branchname-commitId[0:8]" everywhere else, but this does not apply for FlexRIC, and we have to overwrite this here. --- ci-scripts/main.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 2c0413d343..9bf196338c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -373,15 +373,17 @@ def ExecuteActionWithParam(action): svr_id = test.findtext('svr_id') success = CONTAINERS.Push_Image_to_Local_Registry(HTML, svr_id) - elif action == 'Pull_Local_Registry': + elif action == 'Pull_Local_Registry' or action == 'Clean_Test_Server_Images': svr_id = test.findtext('svr_id') images = test.findtext('images').split() - success = CONTAINERS.Pull_Image_from_Registry(HTML, svr_id, images) - - elif action == 'Clean_Test_Server_Images': - svr_id = test.findtext('svr_id') - images = test.findtext('images').split() - success = CONTAINERS.Clean_Test_Server_Images(HTML, svr_id, images) + # hack: for FlexRIC, we need to overwrite the tag to use + tag = None + if len(images) == 1 and images[0] == "oai-flexric": + tag = CONTAINERS.flexricTag + if action == "Pull_Local_Registry": + success = CONTAINERS.Pull_Image_from_Registry(HTML, svr_id, images, tag=tag) + if action == "Clean_Test_Server_Images": + success = CONTAINERS.Clean_Test_Server_Images(HTML, svr_id, images, tag=tag) elif action == 'Custom_Command': node = test.findtext('node')