mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +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()
|
exec := exec.New()
|
||||||
out, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
out, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Failed to nsenter mount, return file doesn't exist: %v", err)
|
glog.V(2).Infof("Failed findmnt command: %v", err)
|
||||||
// If the command itself is correct, then if we encountered error
|
// Different operating systems behave differently for paths which are not mount points.
|
||||||
// then most likely this means that the directory does not exist.
|
// On older versions (e.g. 2.20.1) we'd get error, on newer ones (e.g. 2.26.2) we'd get "/".
|
||||||
return true, os.ErrNotExist
|
// It's safer to assume that it's not a mount point.
|
||||||
|
return true, nil
|
||||||
}
|
}
|
||||||
strOut := strings.TrimSuffix(string(out), "\n")
|
strOut := strings.TrimSuffix(string(out), "\n")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user