mirror of
https://github.com/twuni/docker-registry.helm.git
synced 2026-08-27 06:17:17 +00:00
refactor logic for lapels and annotations and fix resources
This commit is contained in:
+9
-20
@@ -30,27 +30,13 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.garbageCollect.podLabels }}
|
||||
{{- with .Values.garbageCollect.podLabels }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- else if .Values.podLabels }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.podLabels .Values.garbageCollect.podLabels }}
|
||||
{{- toYaml (merge (.Values.podLabels | default (dict)) (.Values.garbageCollect.podLabels | default (dict))) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.podAnnotations .Values.garbageCollect.podAnnotations }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
{{- if .Values.garbageCollect.podAnnotations }}
|
||||
{{- with .Values.garbageCollect.podAnnotations }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- else if .Values.podAnnotations }}
|
||||
{{- with .Values.podAnnotations}}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- toYaml (merge (.Values.podAnnotations | default (dict)) (.Values.garbageCollect.podAnnotations | default (dict))) | nindent 12 }}
|
||||
{{- end}}
|
||||
spec:
|
||||
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
|
||||
@@ -73,7 +59,10 @@ spec:
|
||||
- garbage-collect
|
||||
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
|
||||
- /etc/docker/registry/config.yml
|
||||
resources: {{ toYaml .Values.garbageCollect.resources | nindent 16 }}
|
||||
{{- if .Values.garbageCollect.resources }}
|
||||
resources:
|
||||
{{- toYaml .Values.garbageCollect.resources | nindent 16 }}
|
||||
{{- end }}
|
||||
env: {{ include "docker-registry.envs" . | nindent 16 }}
|
||||
{{- if .Values.containerSecurityContext.enabled }}
|
||||
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}
|
||||
|
||||
Reference in New Issue
Block a user