mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-25 06:20:24 +00:00
rbd: NodeExpandVolume() should use StagingTargetPath
Form kubernetes v1.19 onwards NodeRequest is getting volume path in StagingTargetPath instead of VolumePath, cephcsi should also use the same. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
parent
200d8089f5
commit
4de1abad5e
@ -701,7 +701,16 @@ func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV
|
|||||||
if volumeID == "" {
|
if volumeID == "" {
|
||||||
return nil, status.Error(codes.InvalidArgument, "volume ID must be provided")
|
return nil, status.Error(codes.InvalidArgument, "volume ID must be provided")
|
||||||
}
|
}
|
||||||
volumePath := req.GetVolumePath()
|
|
||||||
|
// Get volume path
|
||||||
|
// With Kubernetes version>=v1.19.0, expand request carries volume_path and
|
||||||
|
// staging_target_path, what csi requires is staging_target_path.
|
||||||
|
volumePath := req.GetStagingTargetPath()
|
||||||
|
if volumePath == "" {
|
||||||
|
// If Kubernetes version < v1.19.0 the volume_path would be
|
||||||
|
// having the staging_target_path information
|
||||||
|
volumePath = req.GetVolumePath()
|
||||||
|
}
|
||||||
if volumePath == "" {
|
if volumePath == "" {
|
||||||
return nil, status.Error(codes.InvalidArgument, "volume path must be provided")
|
return nil, status.Error(codes.InvalidArgument, "volume path must be provided")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user