fix(miniserve): do not create emptydir if persitence is disabled

This commit is contained in:
WrenIX 2023-08-27 11:22:07 +02:00
parent e6c1b171db
commit 8c5c6cf3e6
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
2 changed files with 7 additions and 7 deletions

View file

@ -2,6 +2,6 @@ apiVersion: v2
name: miniserve name: miniserve
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
type: application type: application
version: 0.3.0 version: 0.3.1
appVersion: "0.24.0" appVersion: "0.24.0"

View file

@ -56,8 +56,10 @@ spec:
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
volumeMounts: volumeMounts:
{{- if .Values.persistence.enabled }}
- name: "data" - name: "data"
mountPath: "/data" mountPath: "/data"
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -71,15 +73,13 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes: volumes:
{{- if .Values.persistence.enabled }}
- name: "data" - 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: hostPath:
path: {{ .Values.persistence.hostPath }} path: {{ .Values.persistence.hostPath }}
{{- else }} {{- else }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "miniserve.fullname" . }}{{- end }} claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "miniserve.fullname" . }}{{- end }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }} {{- end }}
{{- end }}