RasaHQ / helm-charts

Helm charts for Rasa products
https://rasa.com
Apache License 2.0
31 stars 29 forks source link

nil pointer evaluating interface when upper level doesn't exist in .Values #40

Closed kaiogu closed 3 years ago

kaiogu commented 3 years ago

I get the following error when enabling rabbitmq without having a .Values.rabbitmq.service section in values.yaml:

Error: UPGRADE FAILED: template: rasa/templates/deployment.yaml:107:14: executing "rasa/templates/deployment.yaml" at <include "rasa.containers.env" .>: error calling include: template: rasa/templates/_containers-env.yaml:16:3: executing "rasa.containers.env" at <include "rasa-common.rabbitmq.envs" .>: error calling include: template: rasa/charts/rasa-common/templates/_rabbitmq.tpl:30:24: executing "rasa-common.rabbitmq.port" at <.Values.rabbitmq.service.port>: nil pointer evaluating interface {}.port

This is a known helm issue.

The offending lines in this case:

https://github.com/RasaHQ/helm-charts/blob/c792f05385615d7e07a9f83ae3735f4ba0984f61/charts/rasa-common/templates/_rabbitmq.tpl#L26-L31

As it is implemented now, the coalesce is all but useless. This can be worked around in the user side, if an empty .Values.rabbitmq.service is defined, but that almost defeats the purpose of a coalesce/default.

On the side of the Chart, the following line would fix the problem:

{{- default 5672 ((.Values.rabbitmq).service).port -}}
sara-tagger commented 3 years ago

Thanks for raising this issue, @jupyterjazz will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗