Handling Authentication Errors in install_kustomize.sh` #5755
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What happened?
The install_kustomize.sh script is designed to download and install the kustomize binary. However, if a
GITHUB_TOKEN
is set in the environment but is invalid or expired, the script fails with authentication errors, such as Bad credentials.Currently, the script attempts to authenticate with GitHub using the
GITHUB_TOKEN
but does not handle cases where this token is incorrect or invalid, leading to confusing error messages like:Version v5.4.3 does not exist or is not available for linux/amd64.
If the support for the token is expected in the installation script, extending the validation to consider such errors sounds reasonable. I assume this extra block would be enough, at least to give the end user some guidance (mostly when inspecting CI logs):
kustomize/hack/install_kustomize.sh
Lines 144 to 147 in 27d508f
What did you expect to happen?
The script should handle authentication errors gracefully and provide a clear message indicating that there is an issue with the
GITHUB_TOKEN
.How can we reproduce it (as minimally and precisely as possible)?
GITHUB_TOKEN
in your environment.bash install_kustomize.sh 5.4.3
Expected output
downloaded binary
Actual output
Version v5.4.3 does not exist or is not available for linux/amd64.
Kustomize version
5.4.3
Operating system
Linux
The text was updated successfully, but these errors were encountered: