summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-10-29 14:29:48 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-10-29 14:29:48 -0400
commit5180ec985d1ed76174565437dc9c8001781bda28 (patch)
treeac4416aeff7f0f9a2352fb7f23005ecf670520f9 /cmd/podman/images
parent222d8075ab08265c6dce8cf0f26a60c9afb64705 (diff)
downloadpodman-5180ec985d1ed76174565437dc9c8001781bda28.tar.gz
podman-5180ec985d1ed76174565437dc9c8001781bda28.tar.bz2
podman-5180ec985d1ed76174565437dc9c8001781bda28.zip
Fix the `--pull` flag to `podman build` to match Docker
The behavior should be as follows: Unset, pull if missing by default, obey the `--pull-never` and `--pull-always` flags. Set to false, pull never. Set to true, pull always. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/build.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index c53798589..0ff482cd9 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -241,8 +241,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
}
pullPolicy := imagebuildah.PullIfNewer
- if c.Flags().Changed("pull") && !flags.Pull {
- pullPolicy = imagebuildah.PullIfMissing
+ if c.Flags().Changed("pull") {
+ if flags.Pull {
+ pullPolicy = imagebuildah.PullAlways
+ } else {
+ pullPolicy = imagebuildah.PullNever
+ }
}
if flags.PullAlways {
pullPolicy = imagebuildah.PullAlways