-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make downloading of kustomize more robust to GitHub API rate limits #37
Merged
karancode
merged 2 commits into
karancode:master
from
gozer:issue/35/kustomize-download
Dec 22, 2022
Merged
Make downloading of kustomize more robust to GitHub API rate limits #37
karancode
merged 2 commits into
karancode:master
from
gozer:issue/35/kustomize-download
Dec 22, 2022
Conversation
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
Also, introduce `kustomize_install` as a boolean option that can disable installing kustomize alltogether, assuming you install it some other way, like with https://github.com/yokawasa/action-setup-kube-tools Fixes karancode#35
@karancode Any chance of a review and merge of this? Had a pretty rough stretch today trying to get our actions workflows to succeed. |
@gozer looks like this way will fail for older versions (for ex: 3.0.0). Could you please confirm that once ? Thanks! |
100% right, I completely misread the loop and thought it was a retry loop, fixed! ❯ INPUT_KUSTOMIZE_VERSION=3.0.0 sh -x entrypoint.sh
+ main ''
++ dirname entrypoint.sh
+ scriptDir=.
+ source ./kustomize_build.sh
+ parse_inputs
+ '[' 3.0.0 '!=' '' ']'
+ kustomize_version=3.0.0
+ kustomize_build_dir=.
+ '[' '' '!=' '' ']'
+ '[' '' '!=' . ']'
+ kustomize_build_dir=
+ kustomize_comment=0
+ '[' '' == 1 ']'
+ '[' '' == true ']'
+ kustomize_install=1
+ '[' '' == 0 ']'
+ '[' '' == false ']'
+ kustomize_output_file=
+ '[' -n '' ']'
+ kustomize_build_options=
+ '[' -n '' ']'
+ enable_alpha_plugins=
+ '[' '' == 1 ']'
+ '[' '' == true ']'
+ '[' 1 == 1 ']'
+ install_kustomize
+ echo 'getting download url for kustomize 3.0.0'
getting download url for kustomize 3.0.0
+ for i in {1..100}
++ curl --retry-all-errors --fail --retry 30 --retry-max-time 120 -s 'https://api.github.com/repos/kubernetes-sigs/kustomize/releases?per_page=100&page=1'
++ jq -r '.[].assets[] | select(.browser_download_url | test("kustomize(_|.)?(v)?3.0.0_linux_amd64")) | .browser_download_url'
+ url=
+ '[' '!' -z ']'
+ for i in {1..100}
++ curl --retry-all-errors --fail --retry 30 --retry-max-time 120 -s 'https://api.github.com/repos/kubernetes-sigs/kustomize/releases?per_page=100&page=2'
++ jq -r '.[].assets[] | select(.browser_download_url | test("kustomize(_|.)?(v)?3.0.0_linux_amd64")) | .browser_download_url'
+ url=https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64
+ '[' '!' -z https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64 ']'
+ break
+ '[' '!' -z https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64 ']'
+ echo 'Download URL found in https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64'
Download URL found in https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64
+ echo 'Downloading kustomize v3.0.0'
Downloading kustomize v3.0.0
+ [[ https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64 =~ .tar.gz$ ]]
+ curl --retry 30 --retry-max-time 120 -s -S -L https://github.com/kubernetes-sigs/kustomize/releases/download/v3.0.0/kustomize_3.0.0_linux_amd64 -o /usr/bin/kustomize
curl: (23) Failure writing output to destination
+ '[' 23 -ne 0 ']'
+ echo 'Failed to download kustomize v3.0.0.'
Failed to download kustomize v3.0.0.
+ exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also, introduce
kustomize_install
as a boolean option that can disableinstalling kustomize alltogether, assuming you install it some other way,
like with https://github.com/yokawasa/action-setup-kube-tools
Details of Change
Issue
Fixes #35
Test Results