diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-17 14:55:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-17 14:55:14 +0200 |
commit | 76f327f73ff9f5ae67a30186007685b8a2e21d67 (patch) | |
tree | 97f006cbd85cdab9764f52463b6904feba9cdaf5 /libpod/image/image.go | |
parent | 098ce2f33a2117a4b18ef49cacd329d44354f984 (diff) | |
parent | decfea65bed9e84373c8cdc538f79686c0ad40b9 (diff) | |
download | podman-76f327f73ff9f5ae67a30186007685b8a2e21d67.tar.gz podman-76f327f73ff9f5ae67a30186007685b8a2e21d67.tar.bz2 podman-76f327f73ff9f5ae67a30186007685b8a2e21d67.zip |
Merge pull request #3617 from QiWang19/create_pull
add --pull flag for podman create&run
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r-- | libpod/image/image.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index 068491f28..cb7c390c6 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -135,7 +135,7 @@ func (ir *Runtime) NewFromLocal(name string) (*Image, error) { // New creates a new image object where the image could be local // or remote -func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions, forcePull bool, label *string) (*Image, error) { +func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions, label *string, pullType util.PullType) (*Image, error) { span, _ := opentracing.StartSpanFromContext(ctx, "newImage") span.SetTag("type", "runtime") defer span.Finish() @@ -145,11 +145,13 @@ func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile InputName: name, imageruntime: ir, } - if !forcePull { + if pullType != util.PullImageAlways { localImage, err := newImage.getLocalImage() if err == nil { newImage.image = localImage return &newImage, nil + } else if pullType == util.PullImageNever { + return nil, err } } |