Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 597f3f8

Browse files
Madhu-1mergify[bot]
authored andcommitted
replication: set status.State to secondary when VR is marked as
secondary when the VR is marked as secondary the current instance object still contains the status.State as primary not secondary. we need to set the status.State to secondary when the volume is demoted successfully. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent 0ed6cc6 commit 597f3f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

controllers/volumereplication_controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
217217
replicationErr = r.markVolumeAsSecondary(instance, logger, volumeHandle, parameters, secret)
218218
if replicationErr == nil {
219219
logger.Info("volume is not ready to use")
220-
err = r.updateReplicationStatus(instance, logger, getCurrentReplicationState(instance), "volume is degraded")
220+
// set the status.State to secondary as the
221+
// instance.Status.State is primary for the first time.
222+
err = r.updateReplicationStatus(instance, logger, getReplicationState(instance), "volume is marked secondary and is degraded")
221223
if err != nil {
222224
return ctrl.Result{}, err
223225
}

0 commit comments

Comments
 (0)