From fa1a7c615f22c9e244509c3fc0a37ff3cbdb9d84 Mon Sep 17 00:00:00 2001 From: Abhay Krishna Arunachalam Date: Tue, 2 Apr 2024 13:09:58 -0700 Subject: [PATCH] Add IMAGE_OS_VERSION to image-builder buildspecs --- build/lib/generate_staging_buildspec.sh | 7 ++++++- release/staging-build.yml | 15 +++++++++++++++ tools/version-tracker/buildspecs/upgrade.yml | 5 +++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/lib/generate_staging_buildspec.sh b/build/lib/generate_staging_buildspec.sh index 96ddf94289..8404d7f53c 100755 --- a/build/lib/generate_staging_buildspec.sh +++ b/build/lib/generate_staging_buildspec.sh @@ -217,9 +217,14 @@ for project in "${PROJECTS[@]}"; do for val2 in "${ARR_2[@]}"; do BUILDSPEC_NAME=$(basename $buildspec .yml) IDENTIFIER=${org//-/_}_${repo//-/_}_${val1//-/_}_${val2//-/_}_${BUILDSPEC_NAME//-/_} + # TODO: revisit this to make it more dynamic if other projects need it in the future + EXTRA_VARS="" + if [[ "$IDENTIFIER" =~ "kubernetes_sigs_image_builder_bottlerocket" ]]; then + EXTRA_VARS+=",\"IMAGE_OS_VERSION\":\"1\"" + fi ALL_PROJECT_IDS+="\"$IDENTIFIER\"," yq eval -i -P \ - ".batch.build-graph += [{\"identifier\":\"$IDENTIFIER\",$buildspec_field$DEPEND_ON\"env\":{$ARCH_TYPE\"variables\":{\"PROJECT_PATH\": \"projects/$org/$repo\"$CLONE_URL,\"${KEYS[0]}\":\"$val1\",\"${KEYS[1]}\":\"$val2\"}}}]" \ + ".batch.build-graph += [{\"identifier\":\"$IDENTIFIER\",$buildspec_field$DEPEND_ON\"env\":{$ARCH_TYPE\"variables\":{\"PROJECT_PATH\": \"projects/$org/$repo\"$CLONE_URL,\"${KEYS[0]}\":\"$val1\",\"${KEYS[1]}\":\"$val2\"$EXTRA_VARS}}}]" \ $STAGING_BUILDSPEC_FILE done done diff --git a/release/staging-build.yml b/release/staging-build.yml index 7d1750a31d..e5bf79c461 100644 --- a/release/staging-build.yml +++ b/release/staging-build.yml @@ -400,6 +400,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-25 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_ova buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml env: @@ -410,6 +411,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-26 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_ova buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml env: @@ -420,6 +422,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-27 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_ova buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml env: @@ -430,6 +433,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-28 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_ova buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml env: @@ -440,6 +444,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-29 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_25_raw buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml env: @@ -450,6 +455,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-25 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_raw buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml env: @@ -460,6 +466,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-26 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_raw buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml env: @@ -470,6 +477,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-27 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_raw buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml env: @@ -480,6 +488,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-28 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_raw buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml env: @@ -490,6 +499,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-29 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_25_ami buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml env: @@ -500,6 +510,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-25 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_ami buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml env: @@ -510,6 +521,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-26 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_ami buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml env: @@ -520,6 +532,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-27 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_ami buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml env: @@ -530,6 +543,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-28 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_ami buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml env: @@ -540,6 +554,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-29 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_kind buildspec: buildspecs/binaries.yml env: diff --git a/tools/version-tracker/buildspecs/upgrade.yml b/tools/version-tracker/buildspecs/upgrade.yml index 298dd03591..6f714fdd03 100644 --- a/tools/version-tracker/buildspecs/upgrade.yml +++ b/tools/version-tracker/buildspecs/upgrade.yml @@ -233,6 +233,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-25 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_upgrade_buildspec env: type: ARM_CONTAINER @@ -242,6 +243,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-26 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_upgrade_buildspec env: type: ARM_CONTAINER @@ -251,6 +253,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-27 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_upgrade_buildspec env: type: ARM_CONTAINER @@ -260,6 +263,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-28 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_upgrade_buildspec env: type: ARM_CONTAINER @@ -269,6 +273,7 @@ batch: CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder IMAGE_OS: bottlerocket RELEASE_BRANCH: 1-29 + IMAGE_OS_VERSION: "1" - identifier: kubernetes_sigs_kind env: type: ARM_CONTAINER