Skip to content

Apply default-image-pull-policy to agent and checkout containers#842

Merged
DrJosh9000 merged 2 commits into
mainfrom
seemethere/default-pull-policy-all-containers
Mar 18, 2026
Merged

Apply default-image-pull-policy to agent and checkout containers#842
DrJosh9000 merged 2 commits into
mainfrom
seemethere/default-pull-policy-all-containers

Conversation

@DrJosh9000
Copy link
Copy Markdown
Contributor

@DrJosh9000 DrJosh9000 commented Mar 18, 2026

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.

seemethere and others added 2 commits March 18, 2026 12:10
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`.
@DrJosh9000 DrJosh9000 force-pushed the seemethere/default-pull-policy-all-containers branch from c10eead to c5b9e98 Compare March 18, 2026 01:10
Copy link
Copy Markdown
Member

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 Nice

@DrJosh9000 DrJosh9000 merged commit 8d9d08a into main Mar 18, 2026
1 check passed
@DrJosh9000 DrJosh9000 deleted the seemethere/default-pull-policy-all-containers branch March 18, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants