Skip to content

Commit 7979b7b

Browse files
authored
Skip unmount if mountpoint returns 'is not a mountpoint' error (#267)
* Skip unmount if mountpoint returns 'is not a mountpoint' error Signed-off-by: Mayank Sachan <[email protected]> --------- Signed-off-by: Mayank Sachan <[email protected]>
1 parent aca9f69 commit 7979b7b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/mounter/utils/mounter_utils.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ func isMountpoint(pathname string) (bool, error) {
112112
if strings.HasSuffix(outStr, "transport endpoint is not connected") {
113113
return true, nil
114114
}
115+
if strings.HasSuffix(outStr, "is not a mountpoint") {
116+
klog.Infof("Path is NOT a mountpoint: pathname - %s", pathname)
117+
return false, nil
118+
}
115119
klog.Errorf("Failed to check mountpoint for path '%s', error: %v, output: %s", pathname, err, string(out))
116120
return false, fmt.Errorf("failed to check mountpoint for path '%s', error: %v, output: %s", pathname, err, string(out))
117121
}
@@ -120,11 +124,6 @@ func isMountpoint(pathname string) (bool, error) {
120124
return true, nil
121125
}
122126

123-
if strings.HasSuffix(outStr, "is not a mountpoint") {
124-
klog.Infof("Path is NOT a mountpoint: pathname - %s", pathname)
125-
return false, nil
126-
}
127-
128127
return false, nil
129128
}
130129

0 commit comments

Comments
 (0)