Skip to content

Commit

Permalink
Merge pull request #933 from tydra-wang/fix-ossfs-entrypoint
Browse files Browse the repository at this point in the history
ossfs entrypoint should not delay termination if no mountpoints
  • Loading branch information
k8s-ci-robot authored Dec 21, 2023
2 parents fcfe7f8 + c628ec0 commit bf3f9ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion build/fuse-clients/ossfs/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
SIGTERM_DELAY="${SIGTERM_DELAY:-60}"
sigterm_handler() {
delay_term() {
echo "Received SIGTERM signal. Delaying termination for ${SIGTERM_DELAY} seconds..."
while true; do
if ! kill -0 $INTERNAL_PROCESS_PID 2>/dev/null; then
Expand All @@ -17,6 +17,14 @@ sigterm_handler() {
((SIGTERM_DELAY--))
done
}
sigterm_handler() {
if [ -z $(findmnt -t fuse.ossfs -n -o TARGET) ]; then
echo "could not find ossfs mountpoint"
exit 1
else
delay_term
fi
}
trap 'sigterm_handler' SIGTERM
ossfs "$@" &
INTERNAL_PROCESS_PID="$!"
Expand Down
2 changes: 1 addition & 1 deletion pkg/mounter/ossfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"k8s.io/utils/pointer"
)

var defaultOssfsImageTag = "3071afa-aliyun"
var defaultOssfsImageTag = "705dbf0-aliyun"

const (
hostPrefix = "/host"
Expand Down

0 comments on commit bf3f9ff

Please sign in to comment.