From 93544ccfcc2a07b96f21e52e568dc2cf60964265 Mon Sep 17 00:00:00 2001 From: Konstantin Zadorozhny Date: Fri, 24 May 2024 16:21:54 -0700 Subject: [PATCH 1/2] handle image push errors (#178) --- skylib/k8s_gitops.sh.tpl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/skylib/k8s_gitops.sh.tpl b/skylib/k8s_gitops.sh.tpl index 45215802..50396dcf 100644 --- a/skylib/k8s_gitops.sh.tpl +++ b/skylib/k8s_gitops.sh.tpl @@ -56,12 +56,12 @@ function async() { } function waitpids() { - # Wait for all of the subprocesses, failing the script if any of them failed. - if [ "${#PIDS[@]}" != 0 ]; then - for pid in ${PIDS[@]}; do - wait ${pid} - done - fi + # Wait for all of the subprocesses, returning the exit code of the first failed process. + if [ "${#PIDS[@]}" != 0 ]; then + for pid in ${PIDS[@]}; do + wait ${pid} || return $? + done + fi } cd $BUILD_WORKSPACE_DIRECTORY @@ -73,4 +73,6 @@ else TARGET_DIR=$BUILD_WORKSPACE_DIRECTORY fi +# make sure that the scirpt is immediately exits if any command below fails +set -o errexit %{statements} From fa05503ca8a324bfc067c35fd7cea0e669e87f33 Mon Sep 17 00:00:00 2001 From: Yasser Sinjab <3217677+ysinjab@users.noreply.github.com> Date: Tue, 4 Jun 2024 05:50:24 +0300 Subject: [PATCH 2/2] Add support for running Kustomize on Linux ARM64 (#176) Add support for kustomize to run on Linux ARM64 --- skylib/kustomize/kustomize.bzl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skylib/kustomize/kustomize.bzl b/skylib/kustomize/kustomize.bzl index 7e2c5ee0..a6f13b75 100644 --- a/skylib/kustomize/kustomize.bzl +++ b/skylib/kustomize/kustomize.bzl @@ -18,11 +18,16 @@ load("//skylib:stamp.bzl", "stamp") _binaries = { "darwin_amd64": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.5.3/kustomize_v4.5.3_darwin_amd64.tar.gz", "b0a6b0568273d466abd7cd535c556e44aa9ff5f54c07e86ed9f3016b416de992"), "linux_amd64": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.5.3/kustomize_v4.5.3_linux_amd64.tar.gz", "e4dc2f795235b03a2e6b12c3863c44abe81338c5c0054b29baf27dcc734ae693"), + "linux_arm64": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.5.3/kustomize_v4.5.3_linux_arm64.tar.gz", "97cf7d53214388b1ff2177a56404445f02d8afacb9421339c878c5ac2c8bc2c8"), } def _download_binary_impl(ctx): if ctx.os.name == "linux": - platform = "linux_amd64" + current_architecture = ctx.execute(["uname", "-m"]).stdout.strip() + if current_architecture == "aarch64": + platform = "linux_arm64" + else: + platform = "linux_amd64" elif ctx.os.name == "mac os x": platform = "darwin_amd64" else: