fix(k8s): honor scope-configurations image pull secrets over the values.yaml default - #254
Open
pmunoz-null wants to merge 1 commit into
Open
fix(k8s): honor scope-configurations image pull secrets over the values.yaml default#254pmunoz-null wants to merge 1 commit into
pmunoz-null wants to merge 1 commit into
Conversation
pmunoz-null
force-pushed
the
fix/k8s-pull-secrets-provider-precedence
branch
from
September 10, 2026 18:41
f37f3aa to
58e8d6f
Compare
…es.yaml default
The image pull secret resolution in deployment/build_context checked the
values.yaml IMAGE_PULL_SECRETS before the scope-configurations provider.
Since values.yaml always ships that key (ENABLED: true, SECRETS: [ecr-secret]),
the provider branch was unreachable and the documented
security.image_pull_secrets_enabled / security.image_pull_secrets properties
had no effect. Non-EKS clusters (e.g. AKS pulling from ACR) therefore always
rendered a pod referencing a non-existent `ecr-secret`, causing
FailedToRetrieveImagePullSecret and ImagePullBackOff until node-level
credentials kicked in.
Extract the block into resolve_image_pull_secrets() and change the priority to:
1. PULL_SECRETS env var
2. provider, when it explicitly sets image_pull_secrets_enabled
3. values.yaml IMAGE_PULL_SECRETS (unchanged behaviour for anyone not
setting the provider property)
4. disabled
The enabled flag is read with an explicit null-check instead of
get_config_value, because that helper evaluates `<path> // empty` and
turns an explicit `false` into "not set".
Tests: replace the previous test, which asserted on an inline copy of the
logic, with tests that exercise the real function via the same sed
extraction used for validate_status.
pmunoz-null
force-pushed
the
fix/k8s-pull-secrets-provider-precedence
branch
from
September 10, 2026 18:47
58e8d6f to
28737e4
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.
Summary
k8s/deployment/build_contextresolved image pull secrets fromvalues.yamlbefore thescope-configurationsprovider. Becausek8s/values.yamlalways shipsIMAGE_PULL_SECRETS(ENABLED: true,SECRETS: [ecr-secret]), the provider branch was unreachable: thesecurity.image_pull_secrets_enabled/security.image_pull_secretsproperties documented ink8s/README.mdhad no effect.imagePullSecrets: [ecr-secret], a secret that does not exist there →FailedToRetrieveImagePullSecret→ anonymous pull →401→ImagePullBackOff, until node-level registry credentials eventually let the pull through. Deployments succeeded late (tens of seconds to minutes) and with a misleading failure block in the logs.resolve_image_pull_secrets()with this priority:PULL_SECRETSenv var (unchanged)image_pull_secrets_enabledvalues.yamlIMAGE_PULL_SECRETS— unchanged behaviour for every install that does not set the provider propertyBackwards compatible: nothing changes for clusters that don't set the provider property; EKS installs relying on the shipped
ecr-secretdefault keep working. Deliberately does not touchk8s/values.yaml— removing the default there would stripimagePullSecretsfrom those installs.Why
get_config_valueisn't used for the flagIt evaluates
<path> // empty, and jq's//treatsfalseas empty, so an explicitimage_pull_secrets_enabled: falsefrom the provider would read as "not set". The flag is read with an explicit null-check instead; the secrets list still goes throughget_config_value.Tests
The previous test (
image pull secrets: PULL_SECRETS takes precedence…) asserted on an inline copy of theif/else, so it could not catch this. It is replaced by five tests that exercise the real function (extracted via the samesedpattern used forvalidate_status):PULL_SECRETSenv wins over provider and defaultvalues.yamldefault (red before this change)values.yamldefault when the provider is silentbats k8s/deployment/tests/build_context.bats→ 82 ok, 0 failed. Fullk8s/deployment/tests→ 316 ok; the 5 failures inbuild_deployment.bats/grpc_port_shape.batsare pre-existing onbeta(they needgomplate, exit 127 in my environment) and unrelated.Changelog
One-liner added under
## [Unreleased](v1.16.3is already tagged).Not in this PR
K8S_FLAVORiseksby default;aks/aro/gkeshould not inherit an ECR secret name). That changes behaviour for non-EKS installs and deserves its own PR/discussion.