fix(values): consistent usage of postgresql.adminPasswordKey#44
fix(values): consistent usage of postgresql.adminPasswordKey#44muja wants to merge 8 commits intoredhat-developer:mainfrom
Conversation
rm3l
left a comment
There was a problem hiding this comment.
Hi @muja ! Thanks for this contribution.
Error: templates/: template: backstage/charts/upstream/charts/postgresql/templates/primary/statefulset.yaml:385:16: executing "backstage/charts/upstream/charts/postgresql/templates/primary/statefulset.yaml" at <include "common.tplvalues.render" (dict "value" .Values.primary.extraEnvVars "context" $)>: error calling include: template: backstage/charts/common/templates/_tplvalues.tpl:19:8: executing "common.tplvalues.render" at <tpl $value .context>: error calling tpl: error during tpl function execution for "- name: POSTGRESQL_ADMIN_PASSWORD\n valueFrom:\n secretKeyRef:\n key: '{{- include \"postgresql.adminPasswordKey\" }}'\n name: '{{- include \"postgresql.v1.secretName\" . }}'": template: backstage/charts/upstream/charts/postgresql/templates/primary/statefulset.yaml:4:16: executing "backstage/charts/upstream/charts/postgresql/templates/primary/statefulset.yaml" at <include>: wrong number of args for include: want 2 got 1
Could you look into the lint issues reported?
https://github.com/redhat-developer/rhdh-chart/actions/runs/10955059451/job/30920518609?pr=44
Thanks.
|
|
Hi @rm3l I believe I was missing a |
|
It seems that the context differs for the two invocations. The invocations on line 111/112 happen from the {
"auth": {
"backend": {
"enabled": true,
"existingSecret": "",
"value": ""
}
},
"clusterRouterBase": "apps.example.com",
"dynamic": {
"includes": [
"dynamic-plugins.default.yaml"
],
"plugins": []
},
"host": "",
"imagePullSecrets": [],
"imageRegistry": ""
}while the invocation in line 239/240 happens from the {
"auth": {
"backend": {
"enabled": true,
"existingSecret": "",
"value": ""
}
},
"clusterRouterBase": "apps.example.com",
"dynamic": {
"includes": [
"dynamic-plugins.default.yaml"
],
"plugins": []
},
"host": "",
"imagePullSecrets": [],
"imageRegistry": "",
"postgresql": {
"auth": {
"database": "",
"existingSecret": "",
"password": "",
"postgresPassword": "",
"secretKeys": {
"adminPasswordKey": "",
"replicationPasswordKey": "",
"userPasswordKey": ""
},
"username": ""
},
"service": {
"ports": {
"postgresql": ""
}
}
},
"storageClass": ""
}This causes the error. Any idea how to resolve this? |
|
That missing section is defined in the global:
postgresql:
auth: {}
upstream:
auth: {} |
| key: postgres-password | ||
| name: '{{- include "janus-idp.postgresql.secretName" . }}' | ||
| key: '{{- include "postgresql.adminPasswordKey" . }}' | ||
| name: '{{- include "postgresql.v1.secretName" . }}' |
There was a problem hiding this comment.
using this helper here changes the name property from rhdh-chart-postgresql to rhdh-chart-backstage. Is that a breaking change / problem?
|
|
Any update on this? |
|
|
|
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|



Description of the change
Consistently use adminPasswordKey. Overriding this value currently leads to buggy behavior because it is not consistently used everywhere. Specifically the hard-coded
postgres-passwordin one of theextraEnvVarsis causing issues and downstream values files cannot override that easily.Additional Information
Since
janus-idp.postgresql.secretNameis not used anymore, could be considered to delete it, but it might break downstream charts which use that helper.Checklist
Chart.yamlaccording to semver.values.yamland added to the README.md. The pre-commit utility can be used to generate the necessary content. Usepre-commit run -ato apply changes.pre-commithook.ct lintcommand.