Apply default-image-pull-policy to agent and checkout containers#842
Merged
Conversation
3 tasks
The `default-image-pull-policy` config option was only applied to the `copy-agent` init container and `imagecheck-*` containers. The `agent` and `checkout` containers had no `ImagePullPolicy` set, causing Kubernetes to default to `Always` for tagged (non-digest) images. This means every job pod contacts the container registry even when images are pre-cached by a DaemonSet. If DNS to the registry is unavailable (e.g. due to stale Cilium BPF conntrack entries pointing at dead CoreDNS backends), the manifest check fails and the pod enters ImagePullBackOff — despite the image being locally cached. Apply the same `cmp.Or(DefaultImagePullPolicy, defaultPullPolicyForImage)` pattern to the `agent` and `checkout` containers, matching the existing `copy-agent` behavior. When `default-image-pull-policy` is set to `IfNotPresent`, all controller-injected containers now skip the registry check if the image is cached, making job pods resilient to transient DNS/registry outages. Default behavior is unchanged: when the config is empty, tagged images still use `PullAlways` and digest-pinned images use `PullIfNotPresent`.
c10eead to
c5b9e98
Compare
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.
What
Like #841, but with the test updated.
Closes #841
Why
I'd approve and merge #841 but that can't happen with failing CI.