Skip to content

Commit e789f11

Browse files
authored
F2calv/2024 04 improve helm chart (#88)
* handle empty envVars * add more hasKey * added maintainers * remove maintainers * tweak ci
1 parent 1aebb91 commit e789f11

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
chart-repository-prefix: charts/
5555
tag: ${{ needs.versioning.outputs.semVer }}
5656
push-chart: ${{ github.ref_name == github.event.repository.default_branch }}
57+
chart-testing-cli-command: install
5758

5859
release:
5960
needs: [versioning, app, image, chart]

charts/multi-arch-container-rust/templates/deployment.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,53 @@ spec:
2828
{{- toYaml . | nindent 8 }}
2929
{{- end }}
3030
serviceAccountName: {{ include "multi-arch-container-rust.serviceAccountName" . }}
31+
{{- if hasKey .Values "podSecurityContext" }}
3132
securityContext:
3233
{{- toYaml .Values.podSecurityContext | nindent 8 }}
34+
{{- end }}
3335
containers:
3436
- name: {{ .Chart.Name }}
37+
{{- if hasKey .Values "securityContext" }}
3538
securityContext:
3639
{{- toYaml .Values.securityContext | nindent 12 }}
40+
{{- end }}
3741
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3842
imagePullPolicy: {{ .Values.image.pullPolicy }}
3943
ports:
4044
- name: http
4145
containerPort: {{ .Values.service.port }}
4246
protocol: TCP
4347
env:
48+
{{- if hasKey .Values "git" }}
4449
- name: "GIT_REPOSITORY"
4550
value: {{ .Values.git.repository | default "" | quote }}
4651
- name: "GIT_BRANCH"
4752
value: {{ .Values.git.branch | default "" | quote }}
4853
- name: "GIT_COMMIT"
4954
value: {{ .Values.git.commit | default "" | quote }}
55+
{{- end }}
5056
- name: "GIT_TAG"
5157
value: {{ .Values.image.tag | default .Chart.AppVersion }}
58+
{{- if hasKey .Values "github" }}
5259
- name: "GITHUB_WORKFLOW"
5360
value: {{ .Values.github.workflow | default "" | quote }}
5461
- name: "GITHUB_RUN_ID"
5562
value: {{ .Values.github.run_id | int64 | default 0 | quote }}
5663
- name: "GITHUB_RUN_NUMBER"
5764
value: {{ .Values.github.run_number | int64 | default 0 | quote }}
65+
{{- end }}
66+
{{- if hasKey .Values "livenessProbe" }}
5867
livenessProbe:
5968
{{- toYaml .Values.livenessProbe | nindent 12 }}
69+
{{- end }}
70+
{{- if hasKey .Values "readinessProbe" }}
6071
readinessProbe:
6172
{{- toYaml .Values.readinessProbe | nindent 12 }}
73+
{{- end }}
74+
{{- if hasKey .Values "resources" }}
6275
resources:
6376
{{- toYaml .Values.resources | nindent 12 }}
77+
{{- end }}
6478
{{- with .Values.volumeMounts }}
6579
volumeMounts:
6680
{{- toYaml . | nindent 12 }}

0 commit comments

Comments
 (0)