Masterminds / sprig

Useful template functions for Go templates.
http://masterminds.github.io/sprig/
MIT License
4.28k stars 442 forks source link

Sprig functions shouldn't deep-dive into objects #228

Open guice opened 4 years ago

guice commented 4 years ago

I'm using Sprig functions through Helm. They recommended opening the issue here. This is what I posted, which pretty much sums everything up:


When using the following checks in the template, you get undefined interface when you really expect for a waterfall "exists" check:

  type: {{ default "NodePort" .Values.fpm.service.type }}

If you don't define fpm.service within your values file, Helm will fail with:

 <.Values.fpm.service.type>: nil pointer evaluating interface {}.type

Expected behavior would be to stop at .Values.fpm.service check and default to "NodePort".

andye2004 commented 4 years ago

@guice See #227, would not be automatic but would do essentially what you require.