Ask questionsHelm install failed

I'm getting the error below when running azds up

Helm install failed with exit code '1': Error: UPGRADE FAILED: render error in "myproj/templates/secrets.yaml": template: horseman-api/templates/secrets.yaml:9:26: executing "myproj/templates/secrets.yaml" at <b64enc>: wrong type for value; expected string; got map[string]interface {}

Here is the secrets.yaml file that was generated with azds up:

{{- $root := . }}
{{- range $name, $values := .Values.secrets }}
apiVersion: v1
kind: Secret
  name: {{ template "horseman-api.fullname" $root }}-{{ $name | lower }}
  {{- range $key, $value := $values }}
  {{ $key }}: {{ $value | b64enc }}
  {{- end }}
{{- end }}

CLI 1.0.20190423.8 API v3.2


Answer questions sanar-microsoft

Looks like you are adding another level in secrets.yaml. As per the example:

    port: "6380"
    host: ""
    key: "secretkeyhere"

$name will be equal to redis in this statement name: {{ template "horseman-api.fullname" $root }}-{{ $name | lower }}

Everything under redis will be treated as key-value pair and will be part of the data under the secret here:

  {{- range $key, $value := $values }}
  {{ $key }}: {{ $value | b64enc }}
  {{- end }}

If you have another level under a key, the value will be treated like a map[string] but secrets.yaml expects a string.


Related questions

Bad Gateway returned when not in debug mode hot 1
Invalid dockerfile generated hot 1
Add support for multiple project azds debug configuration on vscode extension hot 1
Github User Rank List