Open hawkesn opened 1 month ago
This issue is currently awaiting triage.
SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted
label.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
We have run into this issue several times with all the helm charts we support, and I think I may know what is happening. This may not be your exact issue, but here is my experience.
The Sonarqube helm chart has a configuration for extraInitContainers. Like you would expect, the value is an Array of definitions of init containers that are used during deployment for plugin initialization etc. With the update to kubectl and kustomize v5.4.2, the sonarqube chart stopped working and produced this error.
error: could not merge values: wrong node kind: expected MappingNode but got SequenceNode
No amount reconfiguration of that block of code, would let us get passed the error. I untarred the helm chart and took a look at the values.yml, and this is what I saw:
# Extra init containers to e.g. download required artifacts
extraInitContainers: {}
## Array of extra containers to run alongside the sonarqube container
##
## Example:
## - name: myapp-container
## image: busybox
## command: ['sh', '-c', 'echo Hello && sleep 3600']
##
extraContainers: []
Notice that extraContainers is defined as a Sequence, but extraInitContainers is defined as a Map. I think that is the issue, kustomize is loading the values file, and creating a Map around that field, so when kustomize.yaml valuesInLine are used, a sequence cannot be placed into the map.
I was able to fix this by creating a custom-values.yaml with one line:
extraInitContainers: []
and then included it with:
helmCharts:
...
valuesFile: custom-values.yaml
valuesInline:
...
And that fixed our issue. Hope this helps.
What happened?
When running Kustomize on 5.3.0 on a file, I am able to render the template. However, after upgrading to
5.4.0
I am getting the error: "Error: could not merge values: wrong node kind: expected MappingNode but got SequenceNode"What did you expect to happen?
I expected the template to render as it did previously
How can we reproduce it (as minimally and precisely as possible)?
This file used to work on
5.3.0
, now it does not work on5.4.0
.Run:
kustomize build . --enable-helm
on this fileError in
5.4.0
:Expected output
Actual output
N/A - fails to render
Kustomize version
5.4.0
Operating system
Linux