Skip to content

Commit 2bcd316

Browse files
committed
Create snapshotclass based on snapshotter sidecar version
Signed-off-by: Grant Griffiths <[email protected]>
1 parent 03f4262 commit 2bcd316

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

deploy/kubernetes-1.14/snapshotter/csi-hostpath-snapshotclass.yaml

-5
This file was deleted.

deploy/kubernetes-1.15/snapshotter/csi-hostpath-snapshotclass.yaml

-5
This file was deleted.

deploy/kubernetes-1.16/snapshotter/csi-hostpath-snapshotclass.yaml

-5
This file was deleted.

deploy/kubernetes-1.17/snapshotter/csi-hostpath-snapshotclass.yaml

-6
This file was deleted.

deploy/util/deploy-hostpath.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l
218218
done
219219
220220
# deploy snapshotclass
221-
echo "deploying snapshotclass"
222-
SNAPSHOTCLASS_PATH="${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml"
223-
kubectl apply -f $SNAPSHOTCLASS_PATH
221+
echo "deploying snapshotclass based on snapshotter version"
222+
snapshotter_version="$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter false)"
223+
driver_version="$(basename $PWD)"
224+
if [ version_gt $driver_version "1.16" ]; then
225+
kubectl apply -f "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${snapshotter_version}/examples/kubernetes/snapshotclass.yaml"
226+
fi

0 commit comments

Comments
 (0)