Error converting YAML to JSON: did not find expected key – error in pipeline

You can see the mismatched indentation under regcred:

      imagePullSecrets:
      - name: regcred
      # <-- indented "-"
      #VVV not indented
       securityContext:
        runAsNonRoot: true

which, as luck would have it, is the 38th line in the output YAML

$ helm template --debug my-chart . 2>&1| sed -e '1,/^apiVersion:/d' | sed -ne 38p
       securityContext:

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top