Skip to content

Commit e73d9e8

Browse files
authored
Update gargagecollect cronjob
This adds podLabels and podAnnotations to the cronjob job pod and defaults them to the root podLabels and podAnnotations.
1 parent 541f368 commit e73d9e8

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

templates/cronjob.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,40 @@ spec:
1717
app: {{ template "docker-registry.name" . }}
1818
release: {{ .Release.Name }}
1919
{{- with .Values.podLabels }}
20-
{{ toYaml . | nindent 8 }}
20+
{{- toYaml . | nindent 8 }}
2121
{{- end }}
2222
annotations:
2323
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
2424
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
2525
{{- if .Values.podAnnotations }}
26-
{{ toYaml .Values.podAnnotations | nindent 8 }}
26+
{{- toYaml .Values.podAnnotations | nindent 8 }}
2727
{{- end }}
2828
spec:
2929
template:
30+
metadata:
31+
labels:
32+
release: {{ .Release.Name }}
33+
{{- if .Values.garbageCollect.podLabels }}
34+
{{- with .Values.garbageCollect.podLabels }}
35+
{{- toYaml . | nindent 12 }}
36+
{{- end }}
37+
{{- else if .Values.podLabels }}
38+
{{- with .Values.podLabels }}
39+
{{- toYaml . | nindent 12 }}
40+
{{- end }}
41+
{{- end }}
42+
annotations:
43+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
44+
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
45+
{{- if .Values.garbageCollect.podAnnotations }}
46+
{{- with .Values.garbageCollect.podAnnotations }}
47+
{{- toYaml . | nindent 12 }}
48+
{{- end }}
49+
{{- else if .Values.podAnnotations }}
50+
{{- with .Values.podAnnotations}}
51+
{{- toYaml . | nindent 12 }}
52+
{{- end }}
53+
{{- end }}
3054
spec:
3155
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
3256
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
@@ -49,7 +73,7 @@ spec:
4973
- garbage-collect
5074
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
5175
- /etc/docker/registry/config.yml
52-
resources: {{ toYaml .Values.garbageCollect.resources | nindent 12 }}
76+
resources: {{ toYaml .Values.garbageCollect.resources | nindent 16 }}
5377
env: {{ include "docker-registry.envs" . | nindent 16 }}
5478
{{- if .Values.containerSecurityContext.enabled }}
5579
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}

0 commit comments

Comments
 (0)