mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rbd: add migration secret support to controllerserver functions
This commit adds the migration secret request validation to expand, create controller functions. Ref # https://github.com/ceph/ceph-csi/issues/2509 Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
30333378ef
commit
88911eb4e9
@ -270,19 +270,11 @@ func (ns *NodeServer) NodeStageVolume(
|
||||
}
|
||||
|
||||
volID := req.GetVolumeId()
|
||||
secrets := req.GetSecrets()
|
||||
if util.IsMigrationSecret(secrets) {
|
||||
secrets, err = util.ParseAndSetSecretMapFromMigSecret(secrets)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
}
|
||||
cr, err := util.NewUserCredentials(secrets)
|
||||
cr, err := util.NewUserCredentialsWithMigration(req.GetSecrets())
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
defer cr.DeleteCredentials()
|
||||
|
||||
if acquired := ns.VolumeLocks.TryAcquire(volID); !acquired {
|
||||
log.ErrorLog(ctx, util.VolumeOperationAlreadyExistsFmt, volID)
|
||||
|
||||
@ -315,7 +307,7 @@ func (ns *NodeServer) NodeStageVolume(
|
||||
return nil, status.Error(codes.InvalidArgument, "missing required parameter imageFeatures")
|
||||
}
|
||||
|
||||
rv, err := populateRbdVol(ctx, req, cr, secrets)
|
||||
rv, err := populateRbdVol(ctx, req, cr, req.GetSecrets())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user