-
Notifications
You must be signed in to change notification settings - Fork 45
Description
The devtron-operator chart's NOTES.txt template uses Helm's lookup function without nil checking, causing helm diff to fail with a type error.
Error:
Error: Failed to render chart: exit status 1: Error: template: devtron-operator/templates/NOTES.txt:3:58: executing "devtron-operator/templates/NOTES.txt" at <$liveCm.data>: wrong type for
value; expected map[string]interface {}; got interface {}
Environment:
- Chart version: 0.23.0
- Helm version: 3.x
- helm-diff plugin version: latest
- Kubernetes: 1.32
Steps to Reproduce:
- Install devtron-operator chart
- Run helm diff upgrade devtron devtron/devtron-operator -n devtroncd
Root Cause:
Helm's lookup function returns nil during helm diff / helm template operations because these commands don't query the Kubernetes API server by design. When NOTES.txt accesses $liveCm.data
without checking if $liveCm is nil, the template fails.
Reference: databus23/helm-diff#263
Suggested Fix:
Add nil guards in templates/NOTES.txt:
{{- $liveCm := lookup "v1" "ConfigMap" .Release.Namespace "configmap-name" }}
{{- if $liveCm }}
{{- if $liveCm.data }}
{{/* safe to access $liveCm.data here */}}
{{- end }}
{{- end }}
Impact:
Users cannot use helm diff or helmfile apply (which uses helm-diff) with this chart.