mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #24035 from jsafrane/devel/nsenter-error-messages
Automatic merge from submit-queue Add path to log messages. It is useful to see the path that failed to mount in the log messages. Fixes #23990.
This commit is contained in:
commit
04df711a35
@ -118,7 +118,7 @@ func (n *NsenterMounter) doNsenterMount(source, target, fstype string, options [
|
|||||||
exec := exec.New()
|
exec := exec.New()
|
||||||
outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
||||||
if len(outputBytes) != 0 {
|
if len(outputBytes) != 0 {
|
||||||
glog.V(5).Infof("Output from mount command: %v", string(outputBytes))
|
glog.V(5).Infof("Output of mounting %s to %s: %v", source, target, string(outputBytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
@ -151,7 +151,7 @@ func (n *NsenterMounter) Unmount(target string) error {
|
|||||||
exec := exec.New()
|
exec := exec.New()
|
||||||
outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput()
|
||||||
if len(outputBytes) != 0 {
|
if len(outputBytes) != 0 {
|
||||||
glog.V(5).Infof("Output from mount command: %v", string(outputBytes))
|
glog.V(5).Infof("Output of unmounting %s: %v", target, string(outputBytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
@ -182,7 +182,7 @@ 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.V(2).Infof("Failed findmnt command: %v", err)
|
glog.V(2).Infof("Failed findmnt command for path %s: %v", file, err)
|
||||||
// Different operating systems behave differently for paths which are not mount points.
|
// 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 "/".
|
// 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.
|
// It's safer to assume that it's not a mount point.
|
||||||
@ -190,7 +190,7 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) {
|
|||||||
}
|
}
|
||||||
strOut := strings.TrimSuffix(string(out), "\n")
|
strOut := strings.TrimSuffix(string(out), "\n")
|
||||||
|
|
||||||
glog.V(5).Infof("IsLikelyNotMountPoint findmnt output: %v", strOut)
|
glog.V(5).Infof("IsLikelyNotMountPoint findmnt output for path %s: %v", file, strOut)
|
||||||
if strOut == file {
|
if strOut == file {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user