diff --git a/charts/rsyncd/.helmignore b/charts/rsyncd/.helmignore index 50af03172..0e8a0eb36 100644 --- a/charts/rsyncd/.helmignore +++ b/charts/rsyncd/.helmignore @@ -14,6 +14,7 @@ *.swp *.bak *.tmp +*.orig *~ # Various IDEs .project diff --git a/charts/rsyncd/Chart.yaml b/charts/rsyncd/Chart.yaml index f8c61b107..9bd6c0be0 100644 --- a/charts/rsyncd/Chart.yaml +++ b/charts/rsyncd/Chart.yaml @@ -1,4 +1,7 @@ apiVersion: v1 description: rsyncd helm chart for Kubernetes name: rsyncd -version: 1.3.2 +version: 1.4.0 +maintainers: +- email: jenkins-infra-team@googlegroups.com + name: jenkins-infra-team diff --git a/charts/rsyncd/templates/_helpers.tpl b/charts/rsyncd/templates/_helpers.tpl index 6d101c220..4ad7631e1 100644 --- a/charts/rsyncd/templates/_helpers.tpl +++ b/charts/rsyncd/templates/_helpers.tpl @@ -43,3 +43,22 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} + + +{{/* +Data directory volume definition. Might be defined from parent chart templates or autonomously +based on the presence of the global value provided by the parent chart. +Expected argument: dict{ + "currentRsyncComponent": , + "rootContext": { }, +} +*/}} +{{- define "rsync.datadir-volumedef" -}} +{{- if .currentRsyncComponent.volumeTpl -}} + {{- printf "%s" (tpl .currentRsyncComponent.volumeTpl .rootContext) | trim | trunc 63 }} +{{- else if .currentRsyncComponent.volume -}} + {{- toYaml .currentRsyncComponent.volume -}} +{{- else -}} +emptyDir: {} +{{- end -}} +{{- end -}} diff --git a/charts/rsyncd/templates/deployment.yaml b/charts/rsyncd/templates/deployment.yaml index e0e6cf3fd..174c40c37 100644 --- a/charts/rsyncd/templates/deployment.yaml +++ b/charts/rsyncd/templates/deployment.yaml @@ -94,9 +94,5 @@ spec: sizeLimit: 32Mi {{- range .Values.configuration.components }} - name: datadir-{{ .name }} - {{- if .volume }} - {{- toYaml .volume | nindent 10 }} - {{- else }} - emptyDir: - {{ end }} + {{- include "rsync.datadir-volumedef" (dict "currentRsyncComponent" . "rootContext" .) | nindent 10 }} {{- end }}