From 87a9d935dc68e2f716952cef26d996821e0d547f Mon Sep 17 00:00:00 2001 From: Sascha Schwarze Date: Sat, 16 Nov 2024 20:15:51 +0100 Subject: [PATCH] Add automation to trigger automatic updates of the BuildKit image in our sample build strategies Signed-off-by: Sascha Schwarze --- .github/workflows/check-latest-images.yaml | 2 ++ hack/check-latest-images.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-latest-images.yaml b/.github/workflows/check-latest-images.yaml index a541193c28..474a13490e 100644 --- a/.github/workflows/check-latest-images.yaml +++ b/.github/workflows/check-latest-images.yaml @@ -13,6 +13,8 @@ jobs: include: - image: gcr.io/kaniko-project/executor latest-release-url: https://api.github.com/repos/GoogleContainerTools/kaniko/releases/latest + - image: moby/buildkit + latest-release-url: https://api.github.com/repos/moby/buildkit/releases/latest - image: quay.io/containers/buildah latest-release-url: https://quay.io/api/v1/repository/containers/buildah/tag/ steps: diff --git a/hack/check-latest-images.sh b/hack/check-latest-images.sh index 1f4024e3d8..b00b670cb4 100755 --- a/hack/check-latest-images.sh +++ b/hack/check-latest-images.sh @@ -36,7 +36,7 @@ function update() { echo "[INFO] Processing directory ${DIRECTORY}" # Search the image URL recursively and parse the current image tag - CURRENT_TAG="$( (grep --no-filename --recursive "${IMAGE}:" "${DIRECTORY}" || true) | head --lines=1 | sed -E "s#.*${IMAGE}:([v\.0-9]*).*?#\1#")" + CURRENT_TAG="$( (grep --no-filename --recursive "${IMAGE}:" "${DIRECTORY}" || true) | head --lines=1 | sed -E "s#.*${IMAGE}:([v\.0-9]*(-rootless)?).*?#\1#")" if [ "${CURRENT_TAG}" == "" ]; then echo "[INFO] No image reference found" return @@ -50,6 +50,10 @@ function update() { fi LATEST_TAG="$(curl --silent --retry 3 "${LATEST_RELEASE_URL}" | jq --raw-output "${QUERY}")" + if [[ ${IMAGE} == *buildkit* ]]; then + LATEST_TAG="${LATEST_TAG}-rootless" + fi + echo "[INFO] Determined latest tag ${LATEST_TAG}" # Search and modify the image tag with the latest