-
Notifications
You must be signed in to change notification settings - Fork 2.8k
podman build: correct default pull policy #20124
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
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
podman build --help
says the default is true
which according to the man page equals always
, can you fix it there as well?
That needs fixing in buildah. EDIT: oh, actually I should be able to update it in Podman. |
Is |
Yes, |
c463a3b
to
465828b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Suggestion, should you feel like re-pushing: diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index d780a2e2d..56da8ef32 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -24,6 +24,10 @@ EOF
PODMAN_TIMEOUT=240 run_podman build -t build_test --format=docker $tmpdir
is "$output" ".*COMMIT" "COMMIT seen in log"
+ # $IMAGE is preloaded, so we should never re-pull
+ assert "$output" !~ "Trying to pull" "Default pull policy should be 'missing'"
+ assert "$output" !~ "Writing manifest" "Default pull policy should be 'missing'"
+
run_podman run --rm build_test cat /$rand_filename
is "$output" "$rand_content" "reading generated file in image"
|
The default pull policy is "missing" not "always". Signed-off-by: Valentin Rothberg <[email protected]>
465828b
to
59e295f
Compare
Updated and repushed, thanks @edsantiago ! |
Note: close #20125 once merged. I didn't add that to the commit message. |
/lgtm |
if err := flag.Value.Set("true"); err != nil { | ||
logrus.Errorf("Unable to set --pull to true: %v", err) | ||
flag.DefValue = "missing" | ||
if err := flag.Value.Set("missing"); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm mistaken, this is different than Docker, which does a pull=true
by default.
This change worries me. It seems like every year we decide on different functionality/behavior for pull and its options. For instance, in March 2020, I posted this blog: https://www.redhat.com/sysadmin/podman-image-pulling. In my book, especially if we want to match Docker, This appears to be different than what @vrothberg says where I think the default pull should be pull=true, as I defined above, so that we can emulate Docker. However, I think I made this argument once before and it was shot down. Regardless, I'd like someone to write a document that we can all agree with, and that, going forward, we can use it as the point of truth for what |
Did you read the conversation above (#20124 (comment))? The only thing that changes in this PR is the displayed default in the help message, nothing else. The default behavior is "missing" but
That's not how it's been implemented.
The code and the docs say it, not me ;-)
It behaves like Docker at the moment already. Again, the only the changes in this PR is to display the correct default.
I honestly think you started reviewing this PR on the wrong foot. The last time we wrestled through these details, the behavior was written down in the docs already which clearly state that |
The default pull policy is "missing" not "always".
Fixes: #20125
Does this PR introduce a user-facing change?