mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #21486 from fgrzadkowski/docker_ubuntu_fix
Auto commit by PR queue bot
This commit is contained in:
commit
cdbbeae3e5
@ -176,10 +176,11 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) {
|
||||
exec := exec.New()
|
||||
out, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to nsenter mount, return file doesn't exist: %v", err)
|
||||
// If the command itself is correct, then if we encountered error
|
||||
// then most likely this means that the directory does not exist.
|
||||
return true, os.ErrNotExist
|
||||
glog.V(2).Infof("Failed findmnt command: %v", err)
|
||||
// Different operating systems behave differently for paths which are not mount points.
|
||||
// On older versions (e.g. 2.20.1) we'd get error, on newer ones (e.g. 2.26.2) we'd get "/".
|
||||
// It's safer to assume that it's not a mount point.
|
||||
return true, nil
|
||||
}
|
||||
strOut := strings.TrimSuffix(string(out), "\n")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user