fix: move imagePullSecrets to pod spec level in Helm deployment templates#2975
Open
joonas wants to merge 1 commit intodefenseunicorns:mainfrom
Open
fix: move imagePullSecrets to pod spec level in Helm deployment templates#2975joonas wants to merge 1 commit intodefenseunicorns:mainfrom
imagePullSecrets to pod spec level in Helm deployment templates#2975joonas wants to merge 1 commit intodefenseunicorns:mainfrom
Conversation
…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>
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.
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