summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-09-24 18:38:52 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-09-27 07:25:28 -0400
commit1b5853e64794403d80c4d339c97b61dd63dd093a (patch)
treedbf5862bc0af6adb9b6c4f298a6750c23fe66125 /cmd/podman
parent03d01abec6d028e9d5f60615b0451e42d0611d1d (diff)
downloadpodman-1b5853e64794403d80c4d339c97b61dd63dd093a.tar.gz
podman-1b5853e64794403d80c4d339c97b61dd63dd093a.tar.bz2
podman-1b5853e64794403d80c4d339c97b61dd63dd093a.zip
Properly handle podman run --pull command
Currently the --pull missing|always|never is ignored This PR implements this for local API. For remote we need to default to pullpolicy specified in the containers.conf file. Also fixed an issue when images were matching other images names based on prefix, causing images to always be pulled. I had named an image myfedora and when ever I pulled fedora, the system thought that it there were two images named fedora since it was checking for the name fedora as well as the prefix fedora. I changed it to check for fedora and the prefix /fedora, to prefent failures like I had. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/create.go2
-rw-r--r--cmd/podman/containers/create.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index 7e3dc7fb4..bb4726817 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -363,7 +363,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
)
createFlags.StringVar(
&cf.Pull,
- "pull", "missing",
+ "pull", containerConfig.Engine.PullPolicy,
`Pull image before creating ("always"|"missing"|"never")`,
)
createFlags.BoolVarP(
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index 96d94dc00..d75352848 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -261,6 +261,7 @@ func pullImage(imageName string) (string, error) {
OverrideOS: cliVals.OverrideOS,
OverrideVariant: cliVals.OverrideVariant,
SignaturePolicy: cliVals.SignaturePolicy,
+ PullPolicy: pullPolicy,
})
if pullErr != nil {
return "", pullErr