Merge pull request #8085 from TomSweeneyRedHat/dev/tsweeney/fixpulls

Fix pull method selection
This commit is contained in:
OpenShift Merge Robot 2020-10-29 19:06:51 +01:00 committed by GitHub
commit 222d8075ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -240,14 +240,18 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
}
}
pullPolicy := imagebuildah.PullNever
if flags.Pull {
pullPolicy := imagebuildah.PullIfNewer
if c.Flags().Changed("pull") && !flags.Pull {
pullPolicy = imagebuildah.PullIfMissing
}
if flags.PullAlways {
pullPolicy = imagebuildah.PullAlways
}
if flags.PullNever {
pullPolicy = imagebuildah.PullNever
}
args := make(map[string]string)
if c.Flag("build-arg").Changed {
for _, arg := range flags.BuildArg {