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

Add .values.image.hash to application helm chart #137

Merged
merged 22 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: MediaMarktSaturn
url: https://github.com/MediaMarktSaturn
appVersion: 1.0.0
version: 1.20.1
version: 1.20.2
heubeck marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions charts/application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Generic application chart with common requirements of a typical workload.
| readinessProbe.timeoutSeconds | int | `5` | |
| image.repository | string | `"quay.io/heubeck/examiner"` | |
| image.tag | string | `"1.12.21"` | |
| image.digest | string | `nil` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.tagSemverRange | string | `nil` | |
| image.tagNumerical | string | `nil` | |
Expand Down
12 changes: 12 additions & 0 deletions charts/application/templates/_podTemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ spec:
initContainers: {{ if not .Values.initContainers -}}[]{{- end -}}
{{- range $i := .Values.initContainers }}
- name: {{ $i.name }}
{{- if .image.digest }}
image: "{{ .image.repository }}@{{ .image.digest }}"
{{- else }}
image: "{{ .image.repository }}:{{ .image.tag }}"
{{- end }}
imagePullPolicy: {{ or $i.image.pullPolicy $.Values.initDefaults.image.pullPolicy }}
command: {{ if not $i.command }}[]{{ end }}
{{- range $i.command }}
Expand Down Expand Up @@ -107,7 +111,11 @@ spec:
containers:
{{- range $s := .Values.sidecars }}
- name: {{ $s.name }}
{{- if .image.digest }}
image: "{{ .image.repository }}@{{ .image.digest }}"
{{- else }}
image: "{{ .image.repository }}:{{ .image.tag }}"
{{- end }}
imagePullPolicy: {{ or $s.image.pullPolicy $.Values.sidecarDefaults.image.pullPolicy }}
args: {{ if not $s.args }}[]{{ end }}
{{- range $s.args }}
Expand Down Expand Up @@ -195,7 +203,11 @@ spec:
securityContext:
{{- toYaml .Values.container.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.image.digest }}
image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: {{ if not .Values.container.args }}[]{{ end }}
{{- range .Values.container.args }}
Expand Down
2 changes: 1 addition & 1 deletion charts/application/templates/flux-image-policy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.image.tagUpdateInterval (or .Values.image.tagSemverRange (has .Values.image.tagNumerical (list "asc" "desc")) (has .Values.image.tagAlphabetical (list "asc" "desc")) ) }}
{{- if and .Values.image.tagUpdateInterval (or .Values.image.tagSemverRange (has .Values.image.tagNumerical (list "asc" "desc")) (has .Values.image.tagAlphabetical (list "asc" "desc")) ) (not .Values.image.digest ) }}
{{- if .Capabilities.APIVersions.Has "image.toolkit.fluxcd.io/v1beta2" }}
apiVersion: image.toolkit.fluxcd.io/v1beta2
{{- else }}
Expand Down
2 changes: 1 addition & 1 deletion charts/application/templates/flux-image-repository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.image.tagUpdateInterval (or .Values.image.tagSemverRange .Values.image.tagNumerical .Values.image.tagAlphabetical ) }}
{{- if and .Values.image.tagUpdateInterval (or .Values.image.tagSemverRange .Values.image.tagNumerical .Values.image.tagAlphabetical ) (not .Values.image.digest) }}
{{- if .Capabilities.APIVersions.Has "image.toolkit.fluxcd.io/v1beta2" }}
apiVersion: image.toolkit.fluxcd.io/v1beta2
{{- else }}
Expand Down
3 changes: 3 additions & 0 deletions charts/application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ readinessProbe:
image:
repository: quay.io/heubeck/examiner
tag: 1.12.21
# When image.digest is set the image.tag, imagepolicy and imagerepository is ignored
# e.g. "sha256:b187aed68cc8c75f475efe8aebcc61fc7ca0c5adc2d2c5b8318997c3edc8d32f"
digest:
pullPolicy: IfNotPresent

# ImagePolicy options:
Expand Down
Loading