File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ function rbac_version () {
104
104
function version_gt() {
105
105
versions=$( for ver in " $@ " ; do ver=${ver# release-} ; echo ${ver# v} ; done)
106
106
greaterVersion=${1# " release-" } ;
107
+ greaterVersion=${1# " kubernetes-" } ;
107
108
greaterVersion=${greaterVersion# " v" } ;
108
109
test " $( printf ' %s' " $versions " | sort -V | head -n 1) " ! = " $greaterVersion "
109
110
}
@@ -218,6 +219,9 @@ while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l
218
219
done
219
220
220
221
# 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