Merge pull request #88759 from andyzhangx/csi-dir-fix
feat: ignore mount dir check in csi node stage/publish
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user