0

I am running my pipeline in gitlab .. and this pipeline pull a helmfile from a github repo.. and when i am trying to deploy this error appears when start to put parsing because my values file like that kubeContext: cech027 this is the helmfile `

# Make sure we have the ENV variable set: {{ requiredEnv "ENV" }}

environments:
  default:
    values:
      - environments/defaults.yaml.gotmpl
      - versions.yaml
      - {{ env "ENVCONFIG" |default ".." }}/config/defaults.yaml.gotmpl
      - {{ env "ENVCONFIG" |default ".." }}/config/{{ requiredEnv "ENV" }}/values.yaml.gotmpl
      - systemVersion: {{ (exec "./utils/git-version.sh" (list "")) }}
      - kubeVersion: {{ (exec "./utils/kube-version.sh" (list .Values.kubeContext)) }}
    secrets:
      - {{ env "ENVCONFIG" |default ".." }}/config/secrets.yaml
      - {{ env "ENVCONFIG" |default ".." }}/config/{{ requiredEnv "ENV" }}/secrets.yaml

  local:
    values:
      - environments/defaults.yaml.gotmpl
      - versions.yaml
      - environments/local/values.yaml.gotmpl
      - environments/local/secrets.yaml
      {{- if eq (exec "./utils/fileexists.sh" (list "overrides.yaml.gotmpl")) "true"}}
      - overrides.yaml.gotmpl
      {{- end }}
      {{- if eq (exec "./utils/fileexists.sh" (list "overrides.yaml")) "true"}}
      - overrides.yaml
      {{- end }}
      - systemVersion: {{ (exec "./utils/git-version.sh" (list "dev")) }}
      - kubeVersion: {{ (exec "./utils/kube-version.sh" (list .Values.kubeContext)) }}

---

repositories:
{{- if .Values.helm }}
- name: softsense
  url: {{ .Values.helm.url }}
  username: {{ .Values.helm.username }}
  password: {{ .Values.helm.password }}
{{- if .Values.allowSnapshots }}
- name: softsense-dev
  url: {{ .Values.helm.devURL }}
  username: {{ .Values.helm.username }}
  password: {{ .Values.helm.password }}
{{- end }}
{{- end }}

helmDefaults:
  cleanupOnFail: true
  verify: false # does not work with charts in directories
  wait: true
  timeout: 900
  recreatePods: false # recreatePods is not supported in helm3
  force: false
  kubeContext: {{ .Values.kubeContext }} # force usage of a specific kube-context
  createNamespace: false

` but i have this error since a week ( and we did not do any changes) .. the gitlab uses a runner to run this pipeline..

this is the error : rror during helmfile.yaml.part.0 parsing: template: stringTemplate:11:69: executing "stringTemplate" at <.Values.kubeContext>: map has no entry for key "kubeContext"

and when i run from my local machine it deployed successfully

Narjess
  • 3
  • 3

0 Answers0