server icon indicating copy to clipboard operation
server copied to clipboard

helm chart template securityContext values not translating to the right format in output yaml file

Open noemtz opened this issue 4 years ago • 0 comments

Description

When using the helm chart values file to add extra securityContext configuration for pods deployment, the resulting yaml output files are not formatted correctly hence causing YAML parse error.

Notice this problem is not happening for podSecurityContext variables (which accepts similar values), this one is working ok on every template appollo, ui, etc.

example of the wrong formatting (This is for the apollo deployment yaml):

containers: - name: apollosecurityContext: capabilities: drop: - all

Error received when testing helm template command Error: YAML parse error on prefect-server/templates/apollo/deployment.yaml: error converting YAML to JSON: yaml: line 31: mapping values are not allowed in this context

Expected Behavior

When adding values to securityContext variable (in values.yaml file), the values should be formatted correctly in the output yaml file to be deployed to kubernetes.

values file: apollo: securityContext:
capabilities: drop: - all

output deployment yaml (this is an example of the expected apollo deployment yaml): containers: - name: apollo - securityContext: capabilities: drop: - all

Reproduction

set any value on any of the securityContext variable within the chat values file and run the "helm template" using the modified values file command, use the --debug flag to see the incorrect formatting.

e.g. myvalues.yaml: apollo: securityContext:
capabilities: drop: - all

e.g. helm template command: helm template templatetest prefecthq/prefect-server --values myvalues.yaml

Error received: Error: YAML parse error on prefect-server/templates/apollo/deployment.yaml: error converting YAML to JSON: yaml: line 31: mapping values are not allowed in this context

Environment

using prefect server helm chart version 2021.09.02

helm version: version.BuildInfo{Version:"v3.5.4", GitCommit:"1b5edb69df3d3a08df77c9902dc17af864ff05d1", GitTreeState:"clean", GoVersion:"go1.15.11"}

noemtz avatar Oct 07 '21 04:10 noemtz