Merge "[UUI] Service Mesh Compliance for UUI"
[oom.git] / kubernetes / appc / templates / pv.yaml
index 25257ea..0df2dbf 100644 (file)
 */}}
 {{- $global := . }}
 {{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 {{- range $i, $t := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" $global }}-data{{$i}}
+  name: {{ include "common.fullname" $global }}-data-{{$i}}
   namespace: {{ include "common.namespace" $global }}
   labels:
     app: {{ include "common.fullname" $global }}
     chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
-    release: "{{ $global.Release.Name }}"
+    release: "{{ include "common.release" $global }}"
     heritage: "{{ $global.Release.Service }}"
     name: {{ include "common.fullname" $global }}
 spec:
@@ -35,7 +36,10 @@ spec:
   storageClassName: "{{ include "common.fullname" $global }}-data"
   persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
   hostPath:
-    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ include "common.release" $global }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
 ---
 {{- end -}}
 {{- end -}}
+{{- end -}}
+{{- end -}}