mirror of
https://github.com/containers/podman.git
synced 2025-06-27 05:26:50 +08:00
podman pull should always try to pull
In the case where you have an image local, if the the user runs podman pull, we should always attempt to pull an updated image. Added a forceRemote bool to New (image) so we can differentiate between "pull" or run because the actions differ. Run does not need to pull the latest -- only run. Signed-off-by: baude <bbaude@redhat.com> Closes: #618 Approved by: baude
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user