* fail fast with wrong kubelet rootdir * check /pods dir * check kubelet rootdir /plugins * function check_directory * add more info --------- Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> Co-authored-by: wangshulin <89928606+wangshli@users.noreply.github.com>
This commit is contained in:
parent
76e2621a32
commit
2a141d783c
|
@ -1,7 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
|
||||
rm -f $KUBELET_ROOTDIR/csi-plugins/fuse.csi.fluid.io/csi.sock
|
||||
mkdir -p $KUBELET_ROOTDIR/csi-plugins/fuse.csi.fluid.io
|
||||
# Function to check if a directory exists
|
||||
check_kubelet_rootdir_subfolder() {
|
||||
local dir="$1"
|
||||
|
||||
if [ ! -d "$dir" ]; then
|
||||
echo "Error: subfolder $dir does not exist, please check whether KUBELET_ROOTDIR $KUBELET_ROOTDIR is configured correctly."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_kubelet_rootdir_subfolder "$KUBELET_ROOTDIR/pods"
|
||||
check_kubelet_rootdir_subfolder "$KUBELET_ROOTDIR/plugins"
|
||||
|
||||
rm -f "$KUBELET_ROOTDIR/csi-plugins/fuse.csi.fluid.io/csi.sock"
|
||||
mkdir -p "$KUBELET_ROOTDIR/csi-plugins/fuse.csi.fluid.io"
|
||||
|
||||
fluid-csi start $@
|
||||
|
|
Loading…
Reference in New Issue