Ensure that all options are correctly set when calling node-expand-during-mount

This commit is contained in:
Hemant Kumar
2024-07-15 17:36:30 -04:00
parent 785e68a626
commit 099cb71a53
5 changed files with 88 additions and 5 deletions

View File

@@ -180,6 +180,7 @@ type FakeVolumePlugin struct {
Host volume.VolumeHost
Config volume.VolumeConfig
LastProvisionerOptions volume.VolumeOptions
LastResizeOptions volume.NodeResizeOptions
NewAttacherCallCount int
NewDetacherCallCount int
NodeExpandCallCount int
@@ -494,6 +495,7 @@ func (plugin *FakeVolumePlugin) RequiresFSResize() bool {
func (plugin *FakeVolumePlugin) NodeExpand(resizeOptions volume.NodeResizeOptions) (bool, error) {
plugin.NodeExpandCallCount++
plugin.LastResizeOptions = resizeOptions
if resizeOptions.VolumeSpec.Name() == FailWithInUseVolumeName {
return false, volumetypes.NewFailedPreconditionError("volume-in-use")
}