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

Commit 5c1f953

Browse files
committed
ctrl: Demote volume if the state is primary
Demote the volume only once if the instance state is primary. Signed-off-by: Madhu Rajanna <[email protected]>
1 parent 36b5dee commit 5c1f953

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

controllers/volumereplication_controller.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,8 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
236236
}, nil
237237
}
238238
} else {
239-
replicationErr = r.markVolumeAsSecondary(instance, logger, volumeHandle, replicationHandle, parameters, secret)
240-
// resync volume if successfully marked Secondary
241-
if replicationErr == nil {
242-
requeueForResync, replicationErr = r.resyncVolume(instance, logger, volumeHandle, replicationHandle, parameters, secret)
243-
}
239+
// resync volume as the volume is already marked Secondary
240+
requeueForResync, replicationErr = r.resyncVolume(instance, logger, volumeHandle, replicationHandle, parameters, secret)
244241
}
245242

246243
case replicationv1alpha1.Resync:

0 commit comments

Comments
 (0)