Add support for specifying an image pull policy for containers #7697
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new ContainerPullPolicyAnnotation and WithPullPolicy builder API to allow configuring the container image pull policy for a given container resource. The supported pull policy settings are
Always
,Missing
, andNever
. A pull policy ofAlways
will result in the container image always being pulled when the container is run, regardless of whether a version of the image is cached locally.Missing
is the default Docker behavior; a cached version of the image will be used if available, otherwise it will be pulled from the registry.Never
will never pull images from a remote registry and running the container will fail if the image is not already present in the local image cache.Furthermore, when building a new image from a Dockerfile,
Always
will also force pulling any base images as part of the build,Missing
will use the default behavior of only pulling images that aren't available locally, andNone
will have no effect on the build process (there's no equivalent build time flag forNone
).Example:
Fixes #7350
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):