Skip to content

Commit

Permalink
Merge pull request #36 from techops-services/TECH-3275-Unifying-env-v…
Browse files Browse the repository at this point in the history
…ars-format

TECH-3275 - Unifying env vars format
  • Loading branch information
OleksandrUA authored Jun 17, 2024
2 parents 679c1be + 83da54d commit 7305093
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.31
version: 0.0.32

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.25"
appVersion: "0.0.32"
icon: https://cncf-branding.netlify.app/img/projects/helm/horizontal/color/helm-horizontal-color.png
31 changes: 11 additions & 20 deletions charts/common/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,24 @@ spec:
- image: "{{ $job.image.repository }}:{{ $job.image.tag }}"
imagePullPolicy: {{ $job.image.imagePullPolicy }}
name: {{ $job.name }}
{{- with $job.env }}
{{- if $job.env }}
env:
{{- range $key, $value := . }}
{{- if hasKey $value "type" }}
- name: {{ $key | quote }}
{{- if eq $value.type "kv" }}
value: {{ $value.value | quote }}
{{- else if eq $value.type "parameterStore" }}
{{- range $k, $v := $job.env }}
- name: {{ $k | quote }}
{{- if eq $v.type "kv" }}
value: {{ $v.value | quote }}
{{- else if eq $v.type "parameterStore" }}
valueFrom:
secretKeyRef:
name: "{{ $fullName }}-{{ $value.name }}"
key: "{{ $fullName }}-{{ $value.name }}"
{{- else if eq $value.type "configmapRef" }}
name: "{{ $fullName }}-{{ $v.name }}"
key: "{{ $fullName }}-{{ $v.name }}"
{{- else if eq $v.type "configmapRef" }}
valueFrom:
configMapKeyRef:
name: {{ $value.name | quote }}
key: {{ $value.key | quote }}
name: {{ $v.name | quote }}
key: {{ $v.key | quote }}
{{- end }}
{{- else }}
- name: {{ $value.name | quote }}
value: {{ $value.value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- with $job.envFrom }}
envFrom:
{{ toYaml . | indent 12 }}
{{- end }}
{{- if $job.command }}
command: {{ $job.command }}
Expand Down

0 comments on commit 7305093

Please sign in to comment.