diff --git a/charts/mirrorbits-lite/.helmignore b/charts/mirrorbits-lite/.helmignore index c8d198264..f85b0ee22 100644 --- a/charts/mirrorbits-lite/.helmignore +++ b/charts/mirrorbits-lite/.helmignore @@ -20,4 +20,4 @@ .idea/ *.tmproj .vscode/ -tests/* +tests/ diff --git a/charts/mirrorbits-lite/Chart.yaml b/charts/mirrorbits-lite/Chart.yaml index 016112aee..4e3579aae 100644 --- a/charts/mirrorbits-lite/Chart.yaml +++ b/charts/mirrorbits-lite/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Mirrobits lite helm chart for Kubernetes name: mirrorbits-lite -version: 0.3.0 +version: 0.3.1 appVersion: "v0.5.1" maintainers: - email: jenkins-infra-team@googlegroups.com diff --git a/charts/mirrorbits-lite/templates/_helpers.tpl b/charts/mirrorbits-lite/templates/_helpers.tpl index 2f52e4dfe..9028c8c83 100644 --- a/charts/mirrorbits-lite/templates/_helpers.tpl +++ b/charts/mirrorbits-lite/templates/_helpers.tpl @@ -49,14 +49,14 @@ Data directory volume definition. Might be defined from parent chart templates o based on the presence of the global value provided by the parent chart. */}} {{- define "mirrorbits-lite.data-volume" -}} -{{- if (dig "global" "storage" "enabled" false .Values.AsMap) -}} +{{- if and (dig "global" "storage" "enabled" false .Values.AsMap) .Values.global.storage.claimNameTpl -}} persistentVolumeClaim: - claimName: {{ include "mirrorbits-parent.pvc-name" . }} -{{- else }} - {{- if .Values.repository.persistentVolumeClaim.enabled }} + claimName: {{ printf "%s" (tpl .Values.global.storage.claimNameTpl $) | trim | trunc 63 }} +{{- else -}} + {{- if .Values.repository.persistentVolumeClaim.enabled -}} persistentVolumeClaim: claimName: {{ .Values.repository.name | default (printf "%s-binary" (include "mirrorbits-lite.fullname" .)) }} - {{- else }} + {{- else -}} emptyDir: {} {{- end -}} {{- end -}} diff --git a/charts/mirrorbits-lite/templates/mocks/_helpers.tpl b/charts/mirrorbits-lite/templates/mocks/_helpers.tpl deleted file mode 100644 index a1a914914..000000000 --- a/charts/mirrorbits-lite/templates/mocks/_helpers.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{{- define "mirrorbits-parent.pvc-name" -}} -parent-chart-shared-data -{{- end -}} diff --git a/charts/mirrorbits-lite/tests/parent_values_test.yaml b/charts/mirrorbits-lite/tests/parent_values_test.yaml index 6e4f64f50..713f79f8c 100644 --- a/charts/mirrorbits-lite/tests/parent_values_test.yaml +++ b/charts/mirrorbits-lite/tests/parent_values_test.yaml @@ -10,6 +10,7 @@ set: global: storage: enabled: true + claimNameTpl: '{{ default "parent-chart-shared-data" }}' ingress: enabled: true # Try to specify a ingress which must be ignored (parent prevails)