linode / linode-blockstorage-csi-driver

Container Storage Interface (CSI) Driver for Linode Block Storage
Apache License 2.0
66 stars 55 forks source link

new: Add support for volume cloning #97

Closed lgarber-akamai closed 1 year ago

lgarber-akamai commented 1 year ago

General:

This pull request adds support for the CLONE_VOLUME controller capability, allowing users to clone PVCs backed by Block Storage Volumes.

For example:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-1
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: linode-block-storage
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-1-clone
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 25Gi
  storageClassName: linode-block-storage
  dataSource:
    kind: PersistentVolumeClaim
    name: pvc-1

NOTE: The Linode API does not natively support resizing volumes during the clone operation, so this change makes an additional API call to resize the volume after it has been cloned.

Additionally, this PR bumps linodego to v1.14.1 and makes the corresponding code changes.

I haven't added E2E tests quite yet since the E2E test suite seems to rely on a broken/deprecated dependency (terraform-linode-k8s) and hasn't yet been migrated to LKE.

Resolves #96