Default ImagePullPolicy to IfNotPresent for all workload helpers#705
Merged
stuggi merged 1 commit intoJun 18, 2026
Merged
Conversation
When ImagePullPolicy is not explicitly set on a container and the image tag is "latest" or unset, Kubernetes defaults the policy to Always, causing unnecessary image pulls on every pod restart. This affected ~120 container definitions across all service operators. Add pod.SetPullPolicyDefaults() which sets PullIfNotPresent on any container that lacks an explicit policy, and call it from the Deployment, DaemonSet, StatefulSet, Job, and CronJob CreateOrPatch paths. Containers that already set an explicit policy (including PullAlways) are left unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
stuggi
reviewed
Jun 18, 2026
| var ctrlResult ctrl.Result | ||
| var err error | ||
|
|
||
| pod.SetPullPolicyDefaults(&j.expectedJob.Spec.Template.Spec) |
Contributor
There was a problem hiding this comment.
this might retrigger jobs if that results in the hash to change, but I guess thats ok/needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
ImagePullPolicyis not explicitly set on a container and the image tag is "latest" or unset, Kubernetes defaults the policy toAlways, causing unnecessary image pulls on every pod restart. This affected ~120 container definitions across all service operators.Add
pod.SetPullPolicyDefaults()which setsPullIfNotPresenton any container that lacks an explicit policy, and call it from theDeployment,DaemonSet,StatefulSet,Job, andCronJobCreateOrPatchpaths. Containers that already set an explicit policy (includingPullAlways) are left unchanged.Relates-To: https://redhat.atlassian.net/browse/OSPRH-26843
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com