fix: redis.external.existingSecret fails with helm template in Kustomize (client-side render)#2324
Open
BobVanB wants to merge 2 commits intogoharbor:mainfrom
Open
fix: redis.external.existingSecret fails with helm template in Kustomize (client-side render)#2324BobVanB wants to merge 2 commits intogoharbor:mainfrom
BobVanB wants to merge 2 commits intogoharbor:mainfrom
Conversation
718d210 to
8e103c4
Compare
Signed-off-by: Bob van B <anonymous@example.com>
8e103c4 to
93f889f
Compare
|
This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days. |
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.
Bug:
redis.external.existingSecretfails withhelm templatein Kustomize (client-side render)Summary
When Harbor is rendered via Kustomize Helm integration (
kustomize build --enable-helm/helm templatein a CI/client-side context), settingredis.external.existingSecretcauses template rendering to fail with a nil-pointer error.This blocks a valid use case where credentials must come from Kubernetes Secrets at runtime (not at template time).
Environment
1.18.2helm template ... -f harbor-kustomize-values.yaml -f harbor.yaml ...Minimal values to reproduce
Actual behavior
Rendering fails with a nil-pointer in helper/template chain when chart tries to resolve Redis password from secret during template render.
Error excerpt:
(There is also a coalesce warning about
expose.route.parentRefs, but that appears unrelated to the fatal error.)Expected behavior
helm templateshould succeed in client-side/Kustomize mode whenredis.external.existingSecretis set, without requiring:Credentials should be consumed via
secretKeyRefat runtime.Why this is a bug
For GitOps/Kustomize workflows, rendering is intentionally done without cluster access to runtime secrets.
Requiring secret contents at template time breaks this workflow and prevents secure secret handling.
Proposed fix
When
redis.type=externalandredis.external.existingSecretis set:lookup-dependent credential construction for URLs).valueFrom.secretKeyRef) forREDIS_USERNAME/REDIS_PASSWORD.$(REDIS_USERNAME):$(REDIS_PASSWORD)), or avoid embedding credentials in rendered secrets entirely.redis.external.username/passwordbehavior only as fallback whenexistingSecretis not set.Acceptance criteria
helm templatesucceeds withredis.external.existingSecretin a no-cluster client-side render.existingSecretflows remain backward-compatible.Additional context
This issue impacts GitOps pipelines that use Kustomize+Helm and rely on runtime secret injection for Redis credentials.