Closed vuldin closed 3 months ago
I think this is a "yaml is awful" error.
For historical reasons, extraInitContainers
takes a single string parameter (which is template-expanded) and treated as yaml input.
Although this looks like an ordinary yaml array with the |-
characters at the start, the rules for parsing the |-
-delimited string require additional indentation.
statefulset:
initContainers:
extraInitContainers: |-
- name: "update-advertised-rpc"
image: "mintel/docker-alpine-bash-curl-yq:latest"
command: [ "/bin/bash", "-c" ]
args:
- |
cat << EOF > advertised-rpc.yaml
redpanda:
advertised_rpc_api:
address: $SERVICE_NAME
port: 33145
EOF
yq '. *= load("advertised-rpc.yaml")' /etc/redpanda/redpanda.yaml >> redpanda.yaml
mv redpanda.yaml /etc/redpanda/redpanda.yaml
chown 101:101 /etc/redpanda/redpanda.yaml
I think that values.yaml
includes this extra indentation in the commented-out example but doesn't make it clear that it's required. This isn't helped because it looks like the error message is counting lines from 0; it's currently parsing initContainers
as an object and has found the extraInitContainers: ""
and is looking for another dictionary key, but instead it sees an array element.
Circling back on this, @jan-g was right! Adding the additional (ie. the correct amount of) indentation allowed the extraInitContainers
config to work.
What happened?
I'm trying to create an extra initContainer with the folling values.yaml:
And running into this error:
When I change
extraInitContainers: |-
toextraInitContainers:
I get the following error:I'm following the example in values.yaml for this parameter closely. The only difference is the commands I'm running in the initContainer.
What did you expect to happen?
An initContainer should have been started up successfully.
How can we reproduce it (as minimally and precisely as possible)?. Please include values file.
Anything else we need to know?
No response
Which are the affected charts?
Redpanda
Chart Version(s)
Cloud provider
JIRA Link: K8S-292