fix: use force unmount to fix pod stuck terminating issue

This commit is contained in:
andyzhangx 2020-11-13 14:11:43 +00:00
Родитель a18349d828
Коммит e2743f7ad4
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -131,16 +131,16 @@ unmount() {
exit 0
fi
echo "`date` EXEC: umount $MNTPATH, devname: $devname" >>$LOG
/bin/umount $MNTPATH >> $LOG 2>&1
echo "`date` EXEC: umount -f $MNTPATH, devname: $devname" >>$LOG
/bin/umount -f $MNTPATH >> $LOG 2>&1
if [ "$?" != "0" ]; then
errorLog=`tail -n 1 "${LOG}"`
err "{ \"status\": \"Failed\", \"message\": \"Failed to unmount volume at ${MNTPATH}, error log:${errorLog}\" }"
exit 1
fi
echo "`date` EXEC: rm -r ${MNTPATH}" >> $LOG
rm -r "${MNTPATH}" >> $LOG 2>&1
echo "`date` EXEC: rmdir ${MNTPATH}" >> $LOG
rmdir "${MNTPATH}" >> $LOG 2>&1
log '{"status": "Success"}'
exit 0