Skip to content

Commit 26f9fd1

Browse files
fix isMount method (#193)
Co-authored-by: Ashima <[email protected]>
1 parent cedb747 commit 26f9fd1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/mounter/utils/mounter_utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ func isMountpoint(pathname string) (bool, error) {
102102

103103
out, err := exec.Command("mountpoint", pathname).CombinedOutput()
104104
outStr := strings.ToLower(strings.TrimSpace(string(out)))
105+
klog.Infof("mountpoint status for path '%s', error: %v, output: %s", pathname, err, string(out))
105106
if err != nil {
107+
if strings.HasSuffix(outStr, "transport endpoint is not connected") {
108+
return true, nil
109+
}
106110
klog.Errorf("Failed to check mountpoint for path '%s', error: %v, output: %s", pathname, err, string(out))
107111
return false, fmt.Errorf("failed to check mountpoint for path '%s', error: %v, output: %s", pathname, err, string(out))
108112
}
@@ -116,10 +120,6 @@ func isMountpoint(pathname string) (bool, error) {
116120
return false, nil
117121
}
118122

119-
if strings.HasSuffix(outStr, "transport endpoint is not connected") {
120-
return true, nil
121-
}
122-
123123
return false, nil
124124
}
125125

0 commit comments

Comments
 (0)