Merge pull request #88759 from andyzhangx/csi-dir-fix

feat: ignore mount dir check in csi node stage/publish
This commit is contained in:
Kubernetes Prow Robot
2020-11-09 16:08:40 -08:00
committed by GitHub
4 changed files with 29 additions and 38 deletions

View File

@@ -571,7 +571,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
DevicePath: devicePath,
}
if volumeDeviceMounter != nil {
if volumeDeviceMounter != nil && actualStateOfWorld.GetDeviceMountState(volumeToMount.VolumeName) != DeviceGloballyMounted {
deviceMountPath, err :=
volumeDeviceMounter.GetDeviceMountPath(volumeToMount.VolumeSpec)
if err != nil {
@@ -615,6 +615,17 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
if resizeError != nil {
klog.Errorf("MountVolume.NodeExpandVolume failed with %v", resizeError)
// Resize failed. To make sure NodeExpand is re-tried again on the next attempt
// *before* SetUp(), mark the mounted device as uncertain.
markDeviceUncertainErr := actualStateOfWorld.MarkDeviceAsUncertain(
volumeToMount.VolumeName, devicePath, deviceMountPath)
if markDeviceUncertainErr != nil {
// just log, return the resizeError error instead
klog.Infof(volumeToMount.GenerateMsgDetailed(
"MountVolume.MountDevice failed to mark volume as uncertain",
markDeviceUncertainErr.Error()))
}
return volumeToMount.GenerateError("MountVolume.MountDevice failed while expanding volume", resizeError)
}
}