File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ function rbac_version () {
104104function version_gt() {
105105 versions=$( for ver in " $@ " ; do ver=${ver# release-} ; echo ${ver# v} ; done)
106106 greaterVersion=${1# " release-" } ;
107+ greaterVersion=${1# " kubernetes-" } ;
107108 greaterVersion=${greaterVersion# " v" } ;
108109 test " $( printf ' %s' " $versions " | sort -V | head -n 1) " ! = " $greaterVersion "
109110}
@@ -218,6 +219,9 @@ while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l
218219done
219220
220221# deploy snapshotclass
221- echo " deploying snapshotclass"
222- SNAPSHOTCLASS_PATH=" ${BASE_DIR} /snapshotter/csi-hostpath-snapshotclass.yaml"
223- kubectl apply -f $SNAPSHOTCLASS_PATH
222+ echo " deploying snapshotclass based on snapshotter version"
223+ snapshotter_version=" $( rbac_version " ${BASE_DIR} /hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter false) "
224+ driver_version=" $( basename $PWD ) "
225+ if [ version_gt $driver_version " 1.16" ]; then
226+ kubectl apply -f " https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${snapshotter_version} /examples/kubernetes/snapshotclass.yaml"
227+ fi
You can’t perform that action at this time.
0 commit comments