From 9f886519c4e9d016ca881b18d2bb2047dc6d89d1 Mon Sep 17 00:00:00 2001 From: Mohamed Shafiq Date: Thu, 8 Jan 2026 14:36:03 +0100 Subject: [PATCH] fixed update image file func --- scripts/image_drift.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/image_drift.sh b/scripts/image_drift.sh index e207e3f970..377d152046 100755 --- a/scripts/image_drift.sh +++ b/scripts/image_drift.sh @@ -39,6 +39,13 @@ update_images_yaml_tag() { local current_ref="${2}" local new_tag="${3}" + # shellcheck disable=SC2155 + local current_tag=$(echo "${current_ref}" | awk -F '[:@]' '{print $NF}') + + if [[ "${current_tag}" =~ ^[vV] ]] && [[ ! "${new_tag}" =~ ^[vV] ]]; then + new_tag="v${new_tag}" + fi + local repo="${current_ref%:*}" local updated="${repo}:${new_tag}" # shellcheck disable=SC2016