-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add --pull flag for podman create&run #3617
Conversation
docs/podman-create.1.md
Outdated
**--pull**=*missing* | ||
|
||
Pull image before creating ("always"|"missing"|"never") (default "missing"). | ||
'missing': default value, podman will pull the image if it does not exist in the 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.
Suggest: "exist in the local" to "exist locally". If you take the change, make it throughout. That lines this up with the Buildah verbiage.
pkg/adapter/runtime.go
Outdated
func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool, label *string) (*ContainerImage, error) { | ||
img, err := r.Runtime.ImageRuntime().New(ctx, name, signaturePolicyPath, authfile, writer, dockeroptions, signingoptions, forcePull, label) | ||
func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool, label *string, pull string) (*ContainerImage, error) { | ||
img, err := r.Runtime.ImageRuntime().New(ctx, name, signaturePolicyPath, authfile, writer, dockeroptions, signingoptions, forcePull, label, pull) |
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.
I'd prefer "pullType" for the variable name "pull", just specifies better what the variable is used for and easier to grep for. I'll let @mheon break the tie on the name.
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.
Do we need to keep both focePull
and pullType
as arguments?
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 drop forcePull
Does this line up with Docker functionality? Or at least it's just added functionality and won't break previous scripts? |
I think this lines up with Docker functionality. And this hasn't been added to the current docker release. I just tried this functionality with nightly build of the docker CLI https://download.docker.com/linux/static/nightly/x86_64/ |
@QiWang19 all kinds of test unhappiness |
I think we had reservations about the old patches for this from @haircommander but I don't think they're related to the code as written here. |
3157c7d
to
27d9c0c
Compare
☔ The latest upstream changes (presumably #3656) made this pull request unmergeable. Please resolve the merge conflicts. |
/approve Tagging for 1.5.1 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon, QiWang19 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 |
Is there an option to pull only when there is a newer image? (newer of not exist) |
@abitrolly I think this PR https://github.com/containers/libpod/pull/2618/files implemented |
f0d3c61
to
4b98ccc
Compare
@QiWang19 Lets get this merged, then we can look at Buildah. |
☔ The latest upstream changes (presumably #3744) made this pull request unmergeable. Please resolve the merge conflicts. |
I definitely prefer the "new"
This is affecting I think we can fix the inconsistency by cheating a bit and make |
the |
8dd99d4
to
e6851f1
Compare
Requirement from containers#3575 (comment) Added --pull for podman create and pull to match the newly added flag in docker CLI. `missing`: default value, podman will pull the image if it does not exist in the local. `always`: podman will always pull the image. `never`: podman will never pull the image. Signed-off-by: Qi Wang <qiwan@redhat.com>
Code LGTM |
This patch can get in. Can not change or cheat |
/lgtm |
I think we should have first applied that change to Buildah, then revendor and change the code here. @QiWang19, can you open a PR at Buildah to address it? I really want this flag to be consistent across commands (and tools). |
Requirement from #3575 (comment)
Fixes: #3734
Added --pull for podman create and pull to match the newly added flag in docker CLI.
missing
: default value, podman will pull the image if it does not exist in the local.always
: podman will always pull the image.never
: podman will never pull the image.Signed-off-by: Qi Wang qiwan@redhat.com