Merge pull request #95818 from ping035627/k8s-201023

Clean code: optimize some logs of mount
This commit is contained in:
Kubernetes Prow Robot 2020-11-04 18:10:53 -08:00 committed by GitHub
commit 7eaa7b4861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,8 +196,7 @@ func detectSystemd() bool {
output, err := cmd.CombinedOutput()
if err != nil {
klog.V(2).Infof("Cannot run systemd-run, assuming non-systemd OS")
klog.V(4).Infof("systemd-run failed with: %v", err)
klog.V(4).Infof("systemd-run output: %s", string(output))
klog.V(4).Infof("systemd-run output: %s, failed with: %v", string(output), err)
return false
}
klog.V(2).Infof("Detected OS with systemd")
@ -430,7 +429,7 @@ func (mounter *SafeFormatAndMount) GetDiskFormat(disk string) (string, error) {
klog.V(4).Infof("Attempting to determine if disk %q is formatted using blkid with args: (%v)", disk, args)
dataOut, err := mounter.Exec.Command("blkid", args...).CombinedOutput()
output := string(dataOut)
klog.V(4).Infof("Output: %q, err: %v", output, err)
klog.V(4).Infof("Output: %q", output)
if err != nil {
if exit, ok := err.(utilexec.ExitError); ok {