Skip to content

fix: use IfNotPresent pull policy for Connect content-init container - #177

Open
stevenolen wants to merge 2 commits into
mainfrom
connect-init-pull-if-not-present
Open

stevenolen wants to merge 2 commits into
mainfrom
connect-init-pull-if-not-present

Conversation

@stevenolen

Copy link
Copy Markdown
Contributor

The Connect init-runtime init container on content pods was hardcoded to ImagePullPolicy: Always, so every content start made a live registry call to ghcr.io. A registry hiccup could then fail content starts cluster-wide with ImagePullBackOff even though the image was already cached on every node. The content-init tag is pinned to the Connect version, so this switches it to IfNotPresent and adds a unit test asserting the policy.

The Connect init-runtime init container on content pods was hardcoded to
ImagePullPolicy: Always, so every content start made a live registry call
to ghcr.io. A registry hiccup could then fail content starts cluster-wide
with ImagePullBackOff even though the image was already cached on every
node. The content-init tag is pinned to the Connect version, so switch it
to IfNotPresent and add a unit test asserting the policy.
@stevenolen
stevenolen marked this pull request as ready for review November 20, 2026 18:20
@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @stevenolen's task in 39s —— View job


Review

  • Gather context
  • Read review guidelines
  • Read changed files
  • Post review

The change is correct and well-motivated. PullIfNotPresent is the right policy here — the image tag is pinned to the Connect version, so a cached image is always correct, and Always was an unnecessary reliability hazard.

One suggestion (inline): The 3-line comment in connect_types.go explains the reasoning well, but the codebase convention is a single-line comment. The inline suggestion condenses it without losing the WHY.

No other issues. The test is minimal but sufficient — it asserts the right container name and pull policy, which is exactly what changed.

Comment thread api/core/v1beta1/connect_types.go Outdated
Comment on lines +932 to +935
// The content-init image tag is pinned to the Connect version, so a
// cached copy is always correct. PullAlways forced a registry call on
// every content start, failing starts cluster-wide on registry hiccups.
ImagePullPolicy: corev1.PullIfNotPresent,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The WHY here is worth keeping, but the codebase convention is a single-line comment. Consider condensing:

Suggested change
// The content-init image tag is pinned to the Connect version, so a
// cached copy is always correct. PullAlways forced a registry call on
// every content start, failing starts cluster-wide on registry hiccups.
ImagePullPolicy: corev1.PullIfNotPresent,
// PullIfNotPresent: tag is pinned to Connect version, so a cached copy is always correct.
ImagePullPolicy: corev1.PullIfNotPresent,

@stevenolen

Copy link
Copy Markdown
Contributor Author

@claude again

@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @stevenolen's task in 27s —— View job


Re-review

  • Read current file state
  • Post updated review

The suggestion was applied cleanly. connect_types.go:932 now has the condensed single-line comment:

// PullIfNotPresent: tag is pinned to Connect version, so a cached copy is always correct.
ImagePullPolicy: corev1.PullIfNotPresent,

That matches the codebase convention. The test at connect_types_test.go:439–442 is in place and asserts both the container name and the pull policy. No remaining issues — this is ready to merge.

@stevenolen
stevenolen enabled auto-merge November 20, 2026 20:12
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.

1 participant