mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 04:10:22 +00:00
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 <madhupr007@gmail.com>
This commit is contained in:
parent
385a751b8e
commit
403532c9a6
@ -283,11 +283,6 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context,
|
|||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// extract the force option
|
|
||||||
force, err := getForceOption(ctx, req.GetParameters())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
mirroringInfo, err := rbdVol.getImageMirroringInfo()
|
mirroringInfo, err := rbdVol.getImageMirroringInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -301,7 +296,7 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context,
|
|||||||
|
|
||||||
// promote secondary to primary
|
// promote secondary to primary
|
||||||
if !mirroringInfo.Primary {
|
if !mirroringInfo.Primary {
|
||||||
err = rbdVol.promoteImage(force)
|
err = rbdVol.promoteImage(req.Force)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.ErrorLog(ctx, err.Error())
|
util.ErrorLog(ctx, err.Error())
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user