From 75773824ca469e5dfd3d7b8508ef86500d02e4e2 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 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index 85a1eb3a00..d0c8fe0911 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -51,6 +51,23 @@ function _image_changes_impl() { source sdk_container/.repo/manifests/version.txt local vernum="${FLATCAR_VERSION}" + MAJOR_B=$(echo "${FLATCAR_VERSION}" | cut -d . -f 1) + + SUFFIX= + 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