|
storageclassName := *pvc.Spec.StorageClassName |
The pvc yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: test-sc
name: test-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30G
if we set the storageclass with the metadata.annotations.volume.beta.kubernetes.io/storage-class not spec.storageClassName, when we rebuilding the external-snapshotter sidecar that it will throw nil pointer.
