Planning to reuse the same helm chart folder for different REST services as we have good template variable support.
So I am able to reference {{.Values.application.name}} almost all the yaml and it is working fine.
However in Chart.yml declaring Chart name with {{.Values.application.name}} is giving error.
apiVersion: v2
name: {{.Values.application.name}}
description: A Helm chart for Kubernetes
results error with helm template
Error: cannot load Chart.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".Values.application.name":interface {}(nil)}
helm.go:84: [debug] error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".Values.application.name":interface {}(nil)}
cannot load Chart.yaml
Not sure how to resolve this. Please help.
If there is no helm support for this, then I will go with the below, before running the helm upgrade for every service.
sed -i "s|SERVICE_NAME|$SERVICE|g" helm-package/Chart.yaml
and Chart.yml
---
apiVersion: v2
name: SERVICE_NAME
description: A Helm chart for Kubernetes