-
Notifications
You must be signed in to change notification settings - Fork 794
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
change --pull to be consistent with podman #1803
Conversation
cmd/buildah/bud.go
Outdated
pullPolicy = imagebuildah.PullIfMissing | ||
} | ||
if pullType == buildahcli.PullImageAlways { |
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.
Combine these together with the next section
if pullType == buildahcli.PullImageAlways || iopts.PullAlways {
pullPolicy = imagebuildah.PullAlways
}
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.
Please hide the pullalways code and remove it from man pages.
Also throw an error if the user says to --pull-always and --pull does not match.
@@ -21,7 +21,7 @@ type fromReply struct { | |||
creds string | |||
format string | |||
name string | |||
pull bool | |||
pull string |
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.
This is a breaking change.
If I previously had the script below, it will now break.
listed in registries.conf if a local image does not exist or the image is newer | ||
than the one in storage. Raise an error if the image is not in any listed | ||
registry and is not present locally. | ||
Pull image before building ("always"|"missing"|"never") (default "missing"). |
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.
This is a change. The --pull used to mean to look at the registry and pull if newer. Now that is not an option, as I understand it.
Should their be another option "newer", which should be default and pull a newer image if it exists at the registy otherwise use local.
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.
If current boolean --pull also for pulling the newer image, I need to figure out to prevent buildah from pulling new image when --pull missing
the image exists locally but has a newer version in the registry.
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.
Does buildah --pull
can pull the newer image and replace the old one in the local? I tried the master buildah didn't see the update and didn't find the code implemented this functionality.
@TomSweeneyRedHat Do you know which PR I can refer to for finding newer version image from registry?
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.
buildah bud --pull
is supposed to pull the image if it doesn't exist locally or if the version on the registry is newer there than the version stored locally. I've not tested it recently to verify that it does do that.
Where it happens is fun to find.
https://github.com/containers/buildah/blob/master/new.go#L100 is where resolveImage() is called and the check happens here: https://github.com/containers/buildah/blob/master/new.go#L140
Or at least that's the theory.
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.
thanks, @TomSweeneyRedHat but not code there, that code is for --pull-always.
if bud --pull, buildah will set options.PullPolicy = PullIfMissing, but https://github.com/containers/buildah/blob/master/new.go#L140 is inside the if options.PullPolicy == PullAlways
58ff324
to
e744e0c
Compare
change --pull for bud and from to be consistent with podman change https://github.com/containers/libpod/pull/3617/files Signed-off-by: Qi Wang <[email protected]>
This is a breaking change:
Currently this is legal
With your change, it breaks. |
|
@baude Any ideas? How much hacking would it take to see that fedora was not a valid string and switch it to a missing option. |
☔ The latest upstream changes (presumably 5671417) made this pull request unmergeable. Please resolve the merge conflicts. |
@QiWang19 is this still being worked on, or has it been supplanted by @TomSweeneyRedHat PR #1873 |
I'm not working on this. This PR change --pull from bool to string. This is a breaking change and I don't know how to make --pull work both as boolean and string. |
Lets get #1873 in and then we can discuss this. |
change --pull for bud and from to be consistent with podman change containers/podman#3617
Signed-off-by: Qi Wang [email protected]