-
Notifications
You must be signed in to change notification settings - Fork 10.2k
[bitnami/redis-cluster] Fix service binding password mismatch (#15626) #36230
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
Conversation
Signed-off-by: Leonardo <[email protected]>
Hi! Thank you so much for the PR! Could you bump the chart version? |
a5f70b5
to
a0a41d9
Compare
Hi! Sure, done it |
Signed-off-by: Leonardo M. Miranda <[email protected]>
a0a41d9
to
e63d4ad
Compare
Signed-off-by: Bitnami Bot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @leomichalski, but I'm afraid that the code block you added is redundant to the previous conditional.
This is how the helper would be after this changes:
{{- define "redis-cluster.password" -}}
{{- if not (empty .Values.global.redis.password) }}
{{- .Values.global.redis.password -}}
{{- else if not (empty .Values.password) -}}
{{- .Values.password -}}
{{- else -}}
{{- $password_tmp := default .Values.password (randAlphaNum 10) -}}
{{- $_ := set .Values "password" $password_tmp -}}
{{- .Values.password -}}
{{- end -}}
{{- end -}}
As you can see, the if/else conditionals prioritize these scenarios:
.Values.global.redis.password
is set.Values.password
is set- If none of the above, then set a random password.
This statement in your contribution default .Values.password (randAlphaNum 10)
would not make sense, because for this code to be executed .Values.password
must always be empty.
Signed-off-by: Leonardo M. Miranda <[email protected]>
Hi @migruiz4 , thanks for the review. Indeed, that line was redundant. Now there's just the code that actually fixes the issue.
What will happen now: In the first execution of the What happened before: In the first execution of the |
Signed-off-by: Bitnami Bot <[email protected]>
BTW, after installing the updated chart with helm install --create-namespace redis-cluster bitnami/redis-cluster --namespace test-redis-cluster --set serviceBindings.enabled=true Then, retrieving its values helm get values redis-cluster -n test-redis-cluster --all The password field was still empty. So it seems like helm only sets .Values.password temporarily. |
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary. |
Description of the change
Ensure password is generated only once and reused across templates.
Currently, the Helm chart calls:
in multiple places.
Since include re-runs the template each time, two different random passwords are generated when rendering separate files. This breaks components that expect to share the same credentials.
So the proposed solution is to update the
redis-cluster.password
helper so that it generates the password once and stores it in.Values.password
(only if.Values.password
is empty). Subsequent calls reuse this stored value, ensuring consistency across all templates.Benefits
Be able to use service binding.
Applicable issues
Checklist
Chart.yaml
according to semver. This is not necessary when the changes only affect README.md files.README.md
using readme-generator-for-helmTest