From 4390fc6286a0f566faf543dfb5634dee68af198f Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Mon, 27 Nov 2023 10:44:06 +0100 Subject: [PATCH] image_changes: support multiple LTS When we support two LTS, the oldest one is compare to the newer one (e.g lts-2022 is compared to lts-2023). We now read the 'lts-info' file to find the right version to compare (e.g lts-2022 is compared to the 'current-2022') Signed-off-by: Mathieu Tortuyaux --- ci-automation/image_changes.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index 85a1eb3a006..557dda743a2 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -51,6 +51,22 @@ function _image_changes_impl() { source sdk_container/.repo/manifests/version.txt local vernum="${FLATCAR_VERSION}" + MAJOR_B=$(echo "${FLATCAR_VERSION}" | cut -d . -f 1) + + if [ "${channel}" = "lts" ]; then + curl -fsSLO --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 'https://lts.release.flatcar-linux.net/lts-info' + while read -r LINE; do + # each line is major:year:(supported|unsupported) + TUPLE=(${LINE//:/ }) + MAJOR="${TUPLE[0]}" + if [[ "${MAJOR_B}" = "${MAJOR}" ]]; then + SUFFIX="-${TUPLE[1]}" + break + fi + done