Skip to content

Commit 64e33f6

Browse files
committed
allow fetching latest binaries when using other endpoints/creds
when running under something like us-gov-east-1, the latest-binaries.sh script fails b/c it tries to access the us-west-2 bucket from the wrong endpoints. specify the endpoint url to avoid these kinds of errors: $ ./hack/latest-binaries.sh 1.29 An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied also, specify to perform an unauthenticated s3 api request b/c the govcloud creds wouldn't work against the commercial cloud endpoints and you end up with errors like: $ ./hack/latest-binaries.sh 1.29 An error occurred (InvalidToken) when calling the ListObjectsV2 operation: The provided token is malformed or otherwise invalid.
1 parent e493836 commit 64e33f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hack/latest-binaries.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MINOR_VERSION="${1}"
1313

1414
# retrieve the available "VERSION/BUILD_DATE" prefixes (e.g. "1.28.1/2023-09-14")
1515
# from the binary object keys, sorted in descending semver order, and pick the first one
16-
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)
16+
LATEST_BINARIES=$(aws s3api list-objects-v2 --bucket amazon-eks --prefix "${MINOR_VERSION}" --query 'Contents[*].[Key]' --output text --endpoint-url https://s3.us-west-2.amazonaws.com --no-sign-request | cut -d'/' -f-2 | sort -Vru | head -n1)
1717

1818
if [ "${LATEST_BINARIES}" == "None" ]; then
1919
echo >&2 "No binaries available for minor version: ${MINOR_VERSION}"

0 commit comments

Comments
 (0)