From f052ea3ec33804ea0233e9d049850ff5279a204b Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 26 Jan 2023 15:27:20 -0500 Subject: [PATCH] Set node_stage whenever available --- .../util/operationexecutor/operation_generator.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/volume/util/operationexecutor/operation_generator.go b/pkg/volume/util/operationexecutor/operation_generator.go index 13348a54bc0..c6dcd464d36 100644 --- a/pkg/volume/util/operationexecutor/operation_generator.go +++ b/pkg/volume/util/operationexecutor/operation_generator.go @@ -669,6 +669,16 @@ func (og *operationGenerator) GenerateMountVolumeFunc( resizeOptions.DeviceStagePath = deviceMountPath } + if volumeDeviceMounter != nil && resizeOptions.DeviceStagePath == "" { + deviceStagePath, err := volumeDeviceMounter.GetDeviceMountPath(volumeToMount.VolumeSpec) + if err != nil { + // On failure, return error. Caller will log and retry. + eventErr, detailedErr := volumeToMount.GenerateError("MountVolume.GetDeviceMountPath failed for expansion", err) + return volumetypes.NewOperationContext(eventErr, detailedErr, migrated) + } + resizeOptions.DeviceStagePath = deviceStagePath + } + // No mapping is needed for hostUID/hostGID if userns is not used. // Therefore, just assign the container users to host UID/GID. hostUID := util.FsUserFrom(volumeToMount.Pod)