Merge pull request #8189 from mheon/further_fix_pull_flag

Fix the `--pull` flag to `podman build` to match Docker
This commit is contained in:
OpenShift Merge Robot 2020-10-29 21:31:20 +01:00 committed by GitHub
commit 1ce5ece66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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