Merge pull request #8210 from TomSweeneyRedHat/dev/tsweeney/fixpull2

Match build pull functionality with Docker's
This commit is contained in:
OpenShift Merge Robot
2020-11-02 15:34:20 +01:00
committed by GitHub
2 changed files with 9 additions and 16 deletions

View File

@ -240,13 +240,9 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
} }
} }
pullPolicy := imagebuildah.PullIfNewer pullPolicy := imagebuildah.PullIfMissing
if c.Flags().Changed("pull") { if c.Flags().Changed("pull") && flags.Pull {
if flags.Pull { pullPolicy = imagebuildah.PullAlways
pullPolicy = imagebuildah.PullAlways
} else {
pullPolicy = imagebuildah.PullNever
}
} }
if flags.PullAlways { if flags.PullAlways {
pullPolicy = imagebuildah.PullAlways pullPolicy = imagebuildah.PullAlways

View File

@ -384,16 +384,13 @@ not required for Buildah as it supports only Linux.
**--pull** **--pull**
When the flag is enabled, attempt to pull the latest image from the registries When the option is specified or set to "true", pull the image from the first registry
listed in registries.conf if a local image does not exist or the image is newer it is found in as listed in registries.conf. Raise an error if not found in the
than the one in storage. Raise an error if the image is not in any listed registries, even if the image is present locally.
registry and is not present locally.
If the flag is disabled (with *--pull=false*), do not pull the image from the If the option is disabled (with *--pull=false*), or not specified, pull the image
registry, unless there is no local image. Raise an error if the image is not from the registry only if the image is not present locally. Raise an error if the image
in any registry and is not present locally. is not found in the registries.
Defaults to *true*.
**--pull-always** **--pull-always**