---
apiVersion: v1
kind: PersistentVolumeClaimList
items:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc01
    namespace: test-01
    annotations:
      storage.asset/owner-uid: "999"  #Depricated annotation
      storage.asset/owner-gid: "999"  #Depricated annotation
      volume.pv.provisioner/reclaim-policy: Delete
  spec:
    accessModes:
      - ReadWriteOnce
    volumeMode: Filesystem
    resources:
      requests:
        storage: 10Gi
    storageClassName: storage-class1

- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc02
    namespace: test-01
    annotations:
      storage-asset.pv.provisioner/owner-uid: "998" #New type naming of annotation
      storage-asset.pv.provisioner/owner-gid: "998" #New type naming of annotation
      storage-asset.pv.provisioner/reuse-existing: "true"
  spec:
    accessModes:
      - ReadWriteMany
    volumeMode: Filesystem
    resources:
      requests:
        storage: 10Gi
    storageClassName: storage-class2

- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc03
    namespace: test-01
    annotations:
      volume.pv.provisioner/reclaim-policy: Delete
  spec:
    accessModes:
      - ReadWriteMany
    volumeMode: Block
    resources:
      requests:
        storage: 5Gi
    storageClassName: storage-class3

# Test provisioning of default storage class i.e. without explicitly specified storageClass field
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc04
    namespace: test-01
    annotations:
      volume.pv.provisioner/reclaim-policy: Retain
      storage-asset.pv.provisioner/reuse-existing: "true"
  spec:
    accessModes:
      - ReadWriteMany
    volumeMode: Block
    resources:
      requests:
        storage: 5Gi

# This one should not be provisioned because of a selectors
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc05
    namespace: test-01
  spec:
    accessModes:
      - ReadWriteMany
    volumeMode: Block
    resources:
      requests:
        storage: 5Gi
    selector:
      matchLabels:
        release: "stable"
      matchExpressions:
        - { key: environment, operator: In, values: [dev] }
    storageClassName: storage-class2

# For this PVC the NFS-type PV should be created
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc06
    namespace: test-01
    annotations:
      storage-asset.pv.provisioner/reuse-existing: "yes"
  spec:
    accessModes:
      - ReadWriteMany
    volumeMode: Filesystem
    resources:
      requests:
        storage: 5Gi
    storageClassName: storage-class4
