From 403532c9a6a5f67783d2af41269cfe6db3a6ec7c Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 6 Apr 2021 10:53:38 +0530 Subject: [PATCH] rbd: use force from PromoteVolume Request instead of fetching the force option from the parameters. Use the Force field available in the PromoteVolume Request. Signed-off-by: Madhu Rajanna --- internal/rbd/replicationcontrollerserver.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/rbd/replicationcontrollerserver.go b/internal/rbd/replicationcontrollerserver.go index ef4f1f7db..3cad03d5a 100644 --- a/internal/rbd/replicationcontrollerserver.go +++ b/internal/rbd/replicationcontrollerserver.go @@ -283,11 +283,6 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context, } return nil, err } - // extract the force option - force, err := getForceOption(ctx, req.GetParameters()) - if err != nil { - return nil, err - } mirroringInfo, err := rbdVol.getImageMirroringInfo() if err != nil { @@ -301,7 +296,7 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context, // promote secondary to primary if !mirroringInfo.Primary { - err = rbdVol.promoteImage(force) + err = rbdVol.promoteImage(req.Force) if err != nil { util.ErrorLog(ctx, err.Error()) return nil, status.Error(codes.Internal, err.Error())