summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 009c51886..89da71cb6 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -117,18 +117,20 @@ 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(name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions) (*Image, error) {
+func (ir *Runtime) New(name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions, forcePull bool) (*Image, error) {
// We don't know if the image is local or not ... check local first
newImage := Image{
InputName: name,
Local: false,
imageruntime: ir,
}
- localImage, err := newImage.getLocalImage()
- if err == nil {
- newImage.Local = true
- newImage.image = localImage
- return &newImage, nil
+ if !forcePull {
+ localImage, err := newImage.getLocalImage()
+ if err == nil {
+ newImage.Local = true
+ newImage.image = localImage
+ return &newImage, nil
+ }
}
// The image is not local