[AAF] Use global storage templates for PVC
[oom.git] / kubernetes / aaf / charts / aaf-hello / templates / aaf-hello-pvc.yaml
index 7c45b8b..6882876 100644 (file)
@@ -1,3 +1,4 @@
+{{- if ne 0 (int .Values.global.aaf.hello.replicas) }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
 #########
 ##  ============LICENSE_START====================================================
@@ -33,20 +34,11 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      app: {{ include "common.name" . }}-hello
   accessModes:
     - {{ .Values.persistence.config.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.config.size }}
-{{- if .Values.persistence.config.storageClass }}
-{{- if (eq "-" .Values.persistence.config.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.config.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
+{{- end -}}
 {{- end -}}
-