Error creating subcharts using import values in NOTES.txt
Monocular version: 0.7.2
When creating a chart that uses imported values from subcharts, the deployment does not succeed. The UI reports that there was an error deploying the application. I directly invoked the api endpoint, and the following message is returned:
{
"code": 500,
"message": "Can't create the release: rpc error: code = 2 desc = render error in \"ingress-registry/templates/NOTES.txt\": template: ingress-registry/templates/NOTES.txt:7:15: executing \"ingress-registry/templates/NOTES.txt\" at <.Values.imports.ingr...>: can't evaluate field ingress in type interface {}"
}
Specifically, the error reported is in reference to my using of imported values in NOTES.txt. If I remove the imported values from NOTES.txt, the deployment works fine. The message "can't evaluate field ingress in type interface {}" is referring to a variable I've specified as imported. Here's a snippet of my requirements.yaml:
- name: nginx-ingress
version: "1.0.0"
repository: "https://dev-services.ignitionone.com/resources/kubernetes-support/helm/charts"
import-values:
- child: config
parent: imports.ingress.config
- child: providers
parent: imports.ingress.providers
The default values.yaml file uses imported values, and it works fine when I remove the imports from NOTES.txt. Also, if I use helm install, the imported values in the NOTES.txt are processed ok.
The only problem seems to be with using imported values in NOTES.txt.
Update on this. I was able to work through the issue using a different approach. Rather than importing the values, I referenced the sub-chart values directly. Initially, this caused a problem as the sub-chart names contained a dash, and .Values name resolution using the prescribed pattern in Helm would fail with a parsing error.
If I wanted to access the sub-chart .Values.nginx-ingress.config.type, Helm would not package the chart; erroring out with an unable to parse error. After doing some digging, I found that others have run across this issue and provided an alternative syntax for accessing the values using the format index .Values "nginx-ingress" "config" "type".
The issue of using imported values in NOTES.txt still exists in Monocular (doesn't occur using the Helm CLI), but this pattern of using index to access sub-chart values directly when sub-chart names contains a dash allows me to get the functionality I wanted.