Add a event to PV when mount fails because of fs mismatch

Filesystem mismatch is a special event. This could indicate
either user has asked for incorrect filesystem or there is a error
from which mount operation can not recover on retry.

Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>
This commit is contained in:
Hemant Kumar
2020-01-08 17:08:10 -05:00
parent d88304507d
commit c058073046
6 changed files with 88 additions and 1 deletions

View File

@@ -342,7 +342,7 @@ func (dm *deviceMounter) mountLocalBlockDevice(spec *volume.Spec, devicePath str
if rmErr := os.Remove(deviceMountPath); rmErr != nil {
klog.Warningf("local: failed to remove %s: %v", deviceMountPath, rmErr)
}
return fmt.Errorf("local: failed to mount device %s at %s (fstype: %s), error %v", devicePath, deviceMountPath, fstype, err)
return fmt.Errorf("local: failed to mount device %s at %s (fstype: %s), error %w", devicePath, deviceMountPath, fstype, err)
}
klog.V(3).Infof("local: successfully mount device %s at %s (fstype: %s)", devicePath, deviceMountPath, fstype)
return nil