Skip to content

CR-18557 - move createRuntime to main container #43

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

Merged
merged 15 commits into from
May 18, 2023
Merged
Prev Previous commit
Next Next commit
fixed test
  • Loading branch information
ATGardner committed May 14, 2023
commit 7f6fcbdae6736d2bc576fa0edc778982debbb0ec
26 changes: 15 additions & 11 deletions charts/gitops-runtime/templates/_components/_common_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@
{{ fail "ERROR: env block must be a map"}}
{{- end -}}
{{- end -}}
{{- if empty . -}}
env: []
{{- else -}}
env:
{{- range $name, $val := . }}
{{- if kindIs "string" $val}}
{{- range $name, $val := . }}
{{- if kindIs "string" $val}}
- name: {{ $name }}
value: {{ $val }}
{{- else if kindIs "map" $val}}
{{- if hasKey $val "valueFrom" }}
{{- if or (hasKey $val.valueFrom "secretKeyRef") (hasKey $val.valueFrom "configMapKeyRef") (hasKey $val.valueFrom "fieldRef") }}
{{- else if kindIs "map" $val}}
{{- if hasKey $val "valueFrom" }}
{{- if or (hasKey $val.valueFrom "secretKeyRef") (hasKey $val.valueFrom "configMapKeyRef") (hasKey $val.valueFrom "fieldRef") }}
- name: {{ $name }}
{{- $val | toYaml | nindent 2}}
{{- else}}
{{ fail "ERROR: Only secretKeyRef/configMapKeyRef/fieldRef are supported for valueFrom block for environment variables" }}
{{- end}}
{{- else}}
{{ fail "ERROR: Only secretKeyRef/configMapKeyRef/fieldRef are supported for valueFrom block for environment variables" }}
{{- end}}
{{- else }}
{{ fail "ERROR: Cannot generate environment variables only strings and valueFrom are supported"}}
{{- end }}
{{- else }}
{{ fail "ERROR: Cannot generate environment variables only strings and valueFrom are supported"}}
{{ fail "ERROR: Only maps and string are supported for environment variables"}}
{{- end }}
{{- else }}
{{ fail "ERROR: Only maps and string are supported for environment variables"}}
{{- end }}
{{- end }}
{{- end -}}