From 8c5c6cf3e664693634081d07634de133f5565dc5 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Sun, 27 Aug 2023 11:22:07 +0200 Subject: [PATCH] fix(miniserve): do not create emptydir if persitence is disabled --- miniserve/Chart.yaml | 2 +- miniserve/templates/deployment.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/miniserve/Chart.yaml b/miniserve/Chart.yaml index 6113492..1df3eef 100644 --- a/miniserve/Chart.yaml +++ b/miniserve/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: miniserve description: A Helm chart for Kubernetes type: application -version: 0.3.0 +version: 0.3.1 appVersion: "0.24.0" diff --git a/miniserve/templates/deployment.yaml b/miniserve/templates/deployment.yaml index aa37774..299e1cd 100644 --- a/miniserve/templates/deployment.yaml +++ b/miniserve/templates/deployment.yaml @@ -56,8 +56,10 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: + {{- if .Values.persistence.enabled }} - name: "data" mountPath: "/data" + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -71,15 +73,13 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: + {{- if .Values.persistence.enabled }} - name: "data" - {{- if .Values.persistence.enabled }} - {{- if and .Values.persistence.hostPath (ne .Values.persistence.storageClass "manual" ) }} + {{- if and .Values.persistence.hostPath (ne .Values.persistence.storageClass "manual" ) }} hostPath: path: {{ .Values.persistence.hostPath }} - {{- else }} + {{- else }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "miniserve.fullname" . }}{{- end }} - {{- end }} - {{- else }} - emptyDir: {} {{- end }} + {{- end }}