2

I defined the following ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test-application-yaml
data:
  application.yaml: |-
    testOne: {{ .Values.testOne | nindent 6 }}
    testTwo: {{ .Values.testTwo | nindent 6 }}

The values.yaml looks as follows:

test:
  replicas: 1
  testOne: |
    testOne: "test1"
    testTwo: "test2"
  testTwo: |
    testThree: "test3"
    testFour: "test4"

When executing helm lint -f $v helm/charts/applications on Azure, the following error message is reported:

[ERROR] ... at <6>: invalid value; expected string

When trying it on my machine via helm template -f .\values.yaml . however, i get the configMap correctly indented:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test-application-yaml
data:
  application.yaml: |-
    testOne:
      testOne: "test1"
      testTwo: "test2"

    testTwo:
      testThree: "test3"
      testFour: "test4"

What am I missing here?

z07103
  • 21
  • 3
  • Based on what you have pasted here it's failing because your values yaml structure does not match how you are referencing testOne and testTwo in the template. Values file structure: `test.testOne` vs the template is accessing `.Values.testOne` To match your values file structure the template would need to use `.Values.test.testOne` Great resource for debugging Helm templates: https://helm-playground.com – lance.johnsn Jun 05 '23 at 15:56

0 Answers0