Skip to content

Commit c947b0f

Browse files
committed
create vol snap class if not exists for e2e
Signed-off-by: Tesshu Flower <[email protected]>
1 parent 0dba587 commit c947b0f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

hack/ensure-default-csi.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ updateDefaultVolumeSnapshotClass() {
4242
return 0
4343
fi
4444
done
45+
46+
# At this point no volume snapshot class was found that matches the driver - create one
47+
echo "Creating VolumeStorageClass for ${DRIVER_TO_USE} driver ..."
48+
kubectl create -f - <<SNAPCLASS
49+
apiVersion: snapshot.storage.k8s.io/v1
50+
kind: VolumeSnapshotClass
51+
metadata:
52+
name: test-csi-snap
53+
annotations:
54+
snapshot.storage.kubernetes.io/is-default-class: "true"
55+
driver: ${DRIVER_TO_USE}
56+
deletionPolicy: Delete
57+
SNAPCLASS
58+
4559
}
4660

4761
# Log storageclasses and volumesnapshotclasses (for debug purposes)

0 commit comments

Comments
 (0)