profile
viewpoint

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
metadata:
  name: {{ template "horseman-api.fullname" $root }}-{{ $name | lower }}
data:
  {{- range $key, $value := $values }}
  {{ $key }}: {{ $value | b64enc }}
  {{- end }}
---
{{- end }}

CLI 1.0.20190423.8 API v3.2

Azure/dev-spaces

Answer questions sanar-microsoft

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

  redis:
    port: "6380"
    host: "contosodevredis.redis.cache.windows.net"
    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:

data:
  {{- 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.

useful!

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
source:https://uonfu.com/
Github User Rank List