This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 2e626660 add pvc dataSource
2e626660 is described below

commit 2e626660e671b39d06324139341b5e326d4c7d9d
Author: James Roller, Jr. <[email protected]>
AuthorDate: Mon Aug 5 20:10:12 2024 -0700

    add pvc dataSource
    
    - allow for restoring a volumeSnapshot
---
 charts/templates/pvc.yaml | 8 +++++++-
 charts/values.yaml        | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/charts/templates/pvc.yaml b/charts/templates/pvc.yaml
index 5dfab8fc..640fb9fe 100644
--- a/charts/templates/pvc.yaml
+++ b/charts/templates/pvc.yaml
@@ -20,7 +20,7 @@ kind: PersistentVolumeClaim
 apiVersion: v1
 metadata:
   name: {{ include "answer.fullname" . }}-claim
-  {{- with .Values.persistence.annotations  }}
+  {{- with .Values.persistence.annotations }}
   annotations:
     {{ toYaml . | indent 4 }}
   {{- end }}
@@ -39,4 +39,10 @@ spec:
   resources:
     requests:
       storage: {{ .Values.persistence.size | quote }}
+  {{- with .Values.persistence.dataSource }}
+  dataSource:
+    name: {{ .name }}
+    kind: {{ .kind | default "VolumeSnapshot" }}
+    apiGroup: {{ .apiGroup | default "snapshot.storage.k8s.io" }}
+  {{- end }}
 {{- end }}
\ No newline at end of file
diff --git a/charts/values.yaml b/charts/values.yaml
index 8bb36c46..d932db84 100644
--- a/charts/values.yaml
+++ b/charts/values.yaml
@@ -68,7 +68,7 @@ env:
 
 # Configure extra containers
 extraContainers: []
-  # - name: cloudsql-proxy 
+  # - name: cloudsql-proxy
   #   image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.2
   #   command:
   #     - /cloud-sql-proxy
@@ -91,6 +91,12 @@ persistence:
   accessMode: ReadWriteOnce
   size: 5Gi
   annotations: {}
+  # To restore a PVC from a VolumeSnapshot, set the dataSource;
+  # the kind and apiGroup are optional and default to the shown values
+  dataSource: {}
+    # name: my-volume-snapshot
+    # kind: VolumeSnapshot
+    # apiGroup: snapshot.storage.k8s.io
 
 imagePullSecrets: []
 nameOverride: ""

Reply via email to