Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

harbor.redis.pwdfromsecret should work without lookup #1894

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cthtrifork
Copy link

@cthtrifork cthtrifork commented Dec 18, 2024

Currently harbor.redis.pwdfromsecret fails when using ´dry-run` with helm, as it insist on making a lookup and fails if there is no secret. I have tried to make it fallback.

Otherwise exception is thrown:

 error calling include: template: harbor/templates/_helpers.tpl:182:25: executing "harbor.redis.cred" at <include "harbor.redis.pwdfromsecret" $>: error calling include: template: harbor/templates/_helpers.tpl:176:56: executing "harbor.redis.pwdfromsecret" at <.Values.redis.external.existingSecret>: nil pointer evaluating interface {}.REDIS_PASSWORD  

Currently `harbor.redis.pwdfromsecret` fails when using ´dry-run` with helm, as it insist on making a lookup and fails if there is no secret. I have tried to make it fallback.

Signed-off-by: Casper Thygesen <[email protected]>
@MinerYang
Copy link
Collaborator

MinerYang commented Dec 23, 2024

Hi @cthtrifork ,

I understood this lookup validation would have some issues when using helm templates or dry-run purely cause it needs interactive with Kubernetes API and it is a limitation from helm.
Could you try to use --dry-run=server

Setting --dry-run=server will additionally execute any lookup in your chart towards the server.

ref: https://helm.sh/docs/chart_template_guide/debugging/

@PseudoResonance
Copy link

PseudoResonance commented Jan 6, 2025

This also breaks Helm diff, and Helmfile. Helm diff apparently has an environment variable you can set to enable this, but I can't get it to work through Helmfile, so I have no way to deploy Harbor at all...

Edit: Never mind, I just realized after commenting that I still needed to pass the argument as well as the environment variable. This can be done in the helmDefaults of Helmfile. But it's still annoying to have to set the environment variable outside of Helmfile.

helmDefaults:
  diffArgs:
    - "--dry-run=server"

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.

3 participants