WDaan / hoppscotch-helm

Helm Chart for hoppscotch.io
MIT License
5 stars 4 forks source link

hoppscotch.env_vars - cannot handle strings #5

Closed NicklasWallgren closed 1 year ago

NicklasWallgren commented 1 year ago

It seems as the hoppscotch.env_vars helper function doesn't support env values containing string.

I guess you could remove the if-statement altogether, but I might miss something.

{{/* Format env vars */}}
{{- define "hoppscotch.env_vars" -}}
  {{- with . -}}
    {{- $result := list -}}
    {{- range $name, $value := . -}}
        {{- if or (kindIs "float64" $value) (kindIs "bool" $value) -}}
          {{- $result = append $result (dict "name" $name "value" ($value | toString)) -}}
        {{- else -}}
          {{- $result = append $result (dict "name" $name "value" $value) -}}
        {{- end -}}
      {{- end -}}
    {{- toYaml $result | nindent 0 -}}
  {{- end -}}
{{- end -}}
global:
  env:
    DATABASE_URL: postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch

Error details

Error: INSTALLATION FAILED: template: hoppscotch/templates/web/deployment.yaml:44:17: executing "hoppscotch/templates/web/deployment.yaml" at <include "hoppscotch.env_vars" (deepCopy .Values.web.env | merge .Values.global.env)>: error calling include: template: hoppscotch/templates/_helpers.tpl:104:67: executing "hoppscotch.env_vars" at <tpl $value $>: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function: postgresql://postgres:OwSv34O76Z@my-release-postgresql.postgres-system.svc.cluster.local:5432/hoppscotch: "BasePath" is not a value