@@ -30,27 +30,13 @@ spec:
30
30
metadata :
31
31
labels :
32
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 }}
33
+ {{- if or .Values.podLabels .Values.garbageCollect.podLabels }}
34
+ {{- toYaml (merge (.Values.podLabels | default (dict)) (.Values.garbageCollect.podLabels | default (dict))) | nindent 12 }}
41
35
{{- end }}
36
+ {{- if or .Values.podAnnotations .Values.garbageCollect.podAnnotations }}
42
37
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 }}
38
+ {{- toYaml (merge (.Values.podAnnotations | default (dict)) (.Values.garbageCollect.podAnnotations | default (dict))) | nindent 12 }}
39
+ {{- end}}
54
40
spec :
55
41
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
56
42
serviceAccountName : {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
73
59
- garbage-collect
74
60
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
75
61
- /etc/docker/registry/config.yml
76
- resources : {{ toYaml .Values.garbageCollect.resources | nindent 16 }}
62
+ {{- if .Values.garbageCollect.resources }}
63
+ resources :
64
+ {{- toYaml .Values.garbageCollect.resources | nindent 16 }}
65
+ {{- end }}
77
66
env : {{ include "docker-registry.envs" . | nindent 16 }}
78
67
{{- if .Values.containerSecurityContext.enabled }}
79
68
securityContext : {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}
0 commit comments