# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

{{- if and (eq .Values.storage.type "pvc") .Values.storage.pvc.create }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ .Values.storage.pvc.name }}
  namespace: {{ .Release.Namespace }}
  labels:
    app.kubernetes.io/name: {{ include "snapshot.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/component: storage
spec:
  accessModes:
    - {{ .Values.storage.pvc.accessMode }}
  resources:
    requests:
      storage: {{ .Values.storage.pvc.size }}
  {{- if .Values.storage.pvc.storageClass }}
  storageClassName: {{ .Values.storage.pvc.storageClass }}
  {{- end }}
{{- end }}

