Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hoppscotch.env_vars - cannot handle strings #5

Closed
NicklasWallgren opened this issue Jun 18, 2023 · 0 comments
Closed

hoppscotch.env_vars - cannot handle strings #5

NicklasWallgren opened this issue Jun 18, 2023 · 0 comments

Comments

@NicklasWallgren
Copy link

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
WDaan added a commit that referenced this issue Jun 19, 2023
@WDaan WDaan closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants