-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build with latest binaries by default (#1391)
- Loading branch information
1 parent
79c0b64
commit 1dc843d
Showing
3 changed files
with
84 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "usage: $0 KUBERNETES_MINOR_VERSION" | ||
exit 1 | ||
fi | ||
|
||
MINOR_VERSION="${1}" | ||
|
||
# retrieve the available "VERSION/BUILD_DATE" prefixes (e.g. "1.28.1/2023-09-14") | ||
# from the binary object keys, sorted in descending semver order, and pick the first one | ||
LATEST_BINARIES=$(aws s3api list-objects-v2 --bucket amazon-eks --prefix "${MINOR_VERSION}" --query 'Contents[*].[Key]' --output text | cut -d'/' -f-2 | sort -Vru | head -n1) | ||
|
||
if [ "${LATEST_BINARIES}" == "None" ]; then | ||
echo >&2 "No binaries available for minor version: ${MINOR_VERSION}" | ||
exit 1 | ||
fi | ||
|
||
LATEST_VERSION=$(echo "${LATEST_BINARIES}" | cut -d'/' -f1) | ||
LATEST_BUILD_DATE=$(echo "${LATEST_BINARIES}" | cut -d'/' -f2) | ||
|
||
echo "kubernetes_version=${LATEST_VERSION} kubernetes_build_date=${LATEST_BUILD_DATE}" |