projectnessie / nessie

Nessie: Transactional Catalog for Data Lakes with Git-like semantics
https://projectnessie.org
Apache License 2.0
990 stars 130 forks source link

[Bug]: Helm Chart does not render in version 0.96 because of secretToEnv #9517

Closed Milias closed 3 weeks ago

Milias commented 3 weeks ago

Hello, thanks for working on this project!

We found today that after release 0.96.0 the helm chart does not deploy with the following error:

error deploying nessie: unable to deploy helm chart: 
error executing 'helm upgrade nessie --values /tmp/3296770843 --install /nessie/chart --kube-context pod-context': 
Error: UPGRADE FAILED: 
template: nessie/charts/nessie/templates/deployment.yaml:100:16: executing "nessie/charts/nessie/templates/deployment.yaml" at <include "nessie.secretToEnv" (list $secret "username" (printf "quarkus.datasource.%s.username" $dbKind) false .)>:
error calling include: template: nessie/charts/nessie/templates/_helpers.tpl:339:15: executing "nessie.secretToEnv" at <index . 5>: error calling index: reflect: slice index out of range

I think the update to secretToEnv missed also updating those secrets that are not related to the catalog, specifically those quarkus.datasource environment variables in the deployment. I have fixed it as in this PR, by restoring the previous behavior of secretToEnv by adding a new template secretKeyToEnv, and using it in deployment.yaml.

I don't know if this is the best approach to fix this, but it solves the most immediate issue.

Could you please take a look if possible?

Thanks a lot!

CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

adutra commented 3 weeks ago

Hi @Milias thanks for reporting this, and I agree with your proposed fix.

Could you just do some renaming? I think it would make more sense to rename templates as follows:

Thanks!

Milias commented 3 weeks ago

Thank you @adutra for the quick review!

I changed the names as requested and verified that I didn't accidentally break it.