From 8bd17a7e55b8c16dc85effb4ba526fa117f3eae1 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Fri, 9 Oct 2020 05:15:39 +0500 Subject: [PATCH] Require a name for pvcs --- charts/ix-chart/2010.0.1/questions.yaml | 7 +++++++ charts/ix-chart/2010.0.1/templates/_volumes.tpl | 6 +++--- .../2010.0.1/templates/persistent-volume-claims.yaml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/charts/ix-chart/2010.0.1/questions.yaml b/charts/ix-chart/2010.0.1/questions.yaml index 53a53d3f0c..c523b9e8ea 100644 --- a/charts/ix-chart/2010.0.1/questions.yaml +++ b/charts/ix-chart/2010.0.1/questions.yaml @@ -251,6 +251,8 @@ group: "Storage" schema: type: list + $ref: + - "validations/persistentVolumeClaims" items: - variable: persistentVolumeClaim label: "Persistent Volume Claim Configuration" @@ -268,6 +270,11 @@ schema: type: int required: true + - variable: name + label: "Persistent Volume Claim Name" + schema: + type: string + required: true # Pod Probes # Liveness Probe diff --git a/charts/ix-chart/2010.0.1/templates/_volumes.tpl b/charts/ix-chart/2010.0.1/templates/_volumes.tpl index d40799b294..6da4aee6d5 100644 --- a/charts/ix-chart/2010.0.1/templates/_volumes.tpl +++ b/charts/ix-chart/2010.0.1/templates/_volumes.tpl @@ -10,9 +10,9 @@ volumes: path: {{ $hostPathConfiguration.hostPath }} {{- end }} {{- range $index, $claim := .Values.persistentVolumeClaims }} - - name: ix-pv-{{ $.Release.Name }}-{{ $index }} + - name: ix-pv-{{ $claim.name }} persistentVolumeClaim: - claimName: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} + claimName: ix-{{ $claim.name }} {{- end }} {{- end }} {{- end }} @@ -30,7 +30,7 @@ volumeMounts: {{- end }} {{- range $index, $claim := .Values.persistentVolumeClaims }} - mountPath: {{ $claim.mountPath }} - name: ix-pv-{{ $.Release.Name }}-{{ $index }} + name: ix-pv-{{ $claim.name }} {{- end }} {{- end }} {{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml b/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml index 0f082766fd..1a009af35a 100644 --- a/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml +++ b/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} + name: ix-{{ $claim.name }} spec: storageClassName: ix-storage-class-{{ $.Release.Name }} resources: