Skip to content
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

Update "versions" curl invocation to be more defensive #488

Merged
merged 1 commit into from Apr 2, 2024

Conversation

tianon
Copy link
Member

@tianon tianon commented Apr 2, 2024

This allows the script to differentiate 404 from 503 so that we are less likely to accidentally commit downgrades (like 9b7730d) for temporary failures.

Example output if I change the case to not match 200 anymore:

$ ./versions.sh
error: unexpected status code 200 while fetching: -H Accept: application/json https://github.com/docker/docker/commits/master/hack/dind.atom
Terminated
$ 

This allows the script to differentiate 404 from 503 so that we are less likely to accidentally commit downgrades for temporary failures.
Copy link

@whalelines whalelines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -23,8 +23,22 @@ else
fi
versions=( "${versions[@]%/}" )

scriptPid="$$" # so we can kill the script even from a subshell
_curl() {
exec 42>&1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cute

@yosifkit yosifkit merged commit 1b4d76a into docker-library:master Apr 2, 2024
11 checks passed
@yosifkit yosifkit deleted the defensive-curl branch April 2, 2024 22:30
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Apr 11, 2024
Changes:

- docker-library/docker@b1589f6: Update 26 to 26.0.1
- docker-library/docker@1b4d76a: Merge pull request docker-library/docker#488 from infosiftr/defensive-curl
- docker-library/docker@8114f46: Update "versions" curl invocation to be more defensive
- docker-library/docker@9329f88: Update 26 to compose 2.26.1
- docker-library/docker@9b7730d: Update 26 to compose 2.26.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants