chore: move imagePullSecrets to pod spec level in Helm deployment templates#2975
chore: move imagePullSecrets to pod spec level in Helm deployment templates#2975joonas wants to merge 3 commits into
imagePullSecrets to pod spec level in Helm deployment templates#2975Conversation
…plates
The `imagePullSecrets` block in both `watcherDeployTemplate` and
`admissionDeployTemplate` was indented inside the container list
item. Kubernetes expects `imagePullSecrets` as a sibling of
`containers` and `volumes` under `spec.template.spec`. When nested
inside a container definition, the field is silently ignored,
causing image pulls from private registries to fail with no
diagnostic output.
Move the `{{- if gt (len .Values.imagePullSecrets) 0 }}` block
from inside the container item to the pod spec level in both
templates. The indentation drops from 16 spaces (container field)
to 12 spaces (pod spec field), making `imagePullSecrets` a proper
sibling of `containers`, `serviceAccountName`, and `volumes`.
Add two new tests that assert `imagePullSecrets` shares the same
indentation level as `containers`, preventing regression.
Signed-off-by: Joonas Bergius <joonas@defenseunicorns.com>
Greptile SummaryThis PR fixes a silent Kubernetes misconfiguration where Confidence Score: 5/5Safe to merge — the fix is correct, well-tested, and targeted. All changes are P2 or better. The Kubernetes fix is accurate (imagePullSecrets belongs at pod spec level), the regression tests are sound, and no new risks are introduced. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["spec.template.spec (pod spec)"] --> B["serviceAccountName"]
A --> C["containers (list)"]
A --> D["imagePullSecrets ✅ NOW HERE"]
A --> E["volumes"]
C --> F["- name: watcher/server\n image: ...\n imagePullPolicy: ..."]
style D fill:#90EE90
G["❌ BEFORE: imagePullSecrets was here\n(inside container item, silently ignored)"] -.-> F
Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/helm-imagep..." | Re-trigger Greptile |
imagePullSecrets to pod spec level in Helm deployment templatesimagePullSecrets to pod spec level in Helm deployment templates
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2975 +/- ##
=======================================
Coverage 77.40% 77.40%
=======================================
Files 93 93
Lines 2536 2536
Branches 532 532
=======================================
Hits 1963 1963
Misses 446 446
Partials 127 127
🚀 New features to boost your workflow:
|
Description
The
imagePullSecretsblock in bothwatcherDeployTemplateandadmissionDeployTemplatewas indented inside the container list item. Kubernetes expectsimagePullSecretsas a sibling ofcontainersandvolumesunderspec.template.spec. When nested inside a container definition, the field is silently ignored, causing image pulls from private registries to fail with no diagnostic output.Move the
{{- if gt (len .Values.imagePullSecrets) 0 }}block from inside the container item to the pod spec level in both templates. The indentation drops from 16 spaces (container field) to 12 spaces (pod spec field), makingimagePullSecretsa proper sibling ofcontainers,serviceAccountName, andvolumes.Add two new tests that assert
imagePullSecretsshares the same indentation level ascontainers, preventing regression.End to End Test:
(See Pepr Excellent Examples)
Type of change
Checklist before merging