Repository navigation
container: validate --pull option on create and run - #3692
Merged
Merged
Conversation
Member
Author
vvoland
requested changes
Jun 28, 2022
| if err != nil { | ||
| return err | ||
| reportError(dockerCli.Err(), "create", err.Error(), true) | ||
| return cli.StatusError{StatusCode: 125} |
Collaborator
There was a problem hiding this comment.
Some tests (TestTrustedCreateFromUnreachableTrustServer, TestTrustedCreateFromBadTrustServer, TestNewCreateCommandWithContentTrustErrors) expect exit code 1 here, so they need to be adjusted to account for this change.
Member
Author
There was a problem hiding this comment.
Hm.. good one; thinking of that, I may have been a bit too eager to make this a 125, as createContainer may produce an error for other reasons. I had this part initially elsewhere, but decided to move the validation to createContainer. Let me have a look
thaJeztah
force-pushed
the
validate_pull_opts
branch
4 times, most recently
from
June 28, 2022 11:58
fb1227e to
78da2e2
Compare
Before this change, specifying the `--pull` flag without a value, could
result in the flag after it, or the positional argument to be used as
value.
This patch makes sure that the value is an expected value;
docker create --pull --rm hello-world
docker: invalid pull option: '--rm': must be one of "always", "missing" or "never".
docker run --pull --rm hello-world
docker: invalid pull option: '--rm': must be one of "always", "missing" or "never".
docker run --pull hello-world
docker: invalid pull option: 'hello-world': must be one of "always", "missing" or "never".
Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah
force-pushed
the
validate_pull_opts
branch
from
June 28, 2022 11:59
78da2e2 to
190dac7
Compare
Member
Author
|
thx! bringing this in |
This file contains hidden or 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
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.
docker run's--pullvalues #3681Before this change, specifying the
--pullflag without a value, couldresult in the flag after it, or the positional argument to be used as
value.
This patch makes sure that the value is an expected value;
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)