Bump go to v1.21.6 and set a single source of truth (#10926)

This commit is contained in:
Ricardo Katz 2024-01-27 22:15:14 -03:00 committed by GitHub
parent 02e6ebc95a
commit 5acc4230ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 166 additions and 50 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Copyright 2018 The Kubernetes Authors.
#
@ -25,24 +25,15 @@ set -o errexit
set -o nounset
set -o pipefail
declare -a mandatory
mandatory=(
PKG
ARCH
COMMIT_SHA
REPO_INFO
TAG
)
for var in "${mandatory[@]}"; do
if [[ -z "${!var:-}" ]]; then
echo "Environment variable $var must be set"
exit 1
fi
done
if [ -z "$PKG" ] || [ -z "$ARCH" ] || [ -z "$COMMIT_SHA" ] || [ -z "$REPO_INFO" ] || [ -z "$TAG" ]; then
echo "Environments PKG, ARCH, COMMIT_SHA, REPO_INFO and TAG are required"
exit 1
fi
export CGO_ENABLED=0
export GOARCH=${ARCH}
export GOARCH="${ARCH}"
TARGETS_DIR="rootfs/bin/${ARCH}"
echo "Building targets for ${ARCH}, generated targets in ${TARGETS_DIR} directory."
@ -75,4 +66,4 @@ ${GO_BUILD_CMD} \
-X ${PKG}/version.COMMIT=${COMMIT_SHA} \
-X ${PKG}/version.REPO=${REPO_INFO}" \
-buildvcs=false \
-o "${TARGETS_DIR}/wait-shutdown" "${PKG}/cmd/waitshutdown"
-o "${TARGETS_DIR}/wait-shutdown" "${PKG}/cmd/waitshutdown"