[COMMON] Add missing labels for etcd, mongo, postgres
[oom.git] / kubernetes / common / postgres / templates / pv-primary.yaml
index 096f0c9..e1ff1f9 100644 (file)
@@ -14,6 +14,7 @@
 # # limitations under the License.
 */}}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if include "common.needPV" . -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -22,7 +23,7 @@ metadata:
   labels:
     app: {{ include "common.fullname" . }}
     chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
+    release: "{{ include "common.release" . }}"
     heritage: "{{ .Release.Service }}"
     name: {{ include "common.fullname" . }}
 spec:
@@ -33,5 +34,6 @@ spec:
   storageClassName: "{{ include "common.fullname" . }}-primary"
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/primary
+    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }}/primary
+{{- end -}}
 {{- end -}}