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

Commit 8caf81a

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 fc53e3c commit 8caf81a

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
@@ -237,11 +237,8 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
237237
}, nil
238238
}
239239
} else {
240-
replicationErr = r.markVolumeAsSecondary(instance, logger, volumeHandle, replicationHandle, parameters, secret)
241-
// resync volume if successfully marked Secondary
242-
if replicationErr == nil {
243-
requeueForResync, replicationErr = r.resyncVolume(instance, logger, volumeHandle, replicationHandle, parameters, secret)
244-
}
240+
// resync volume as the volume is already marked Secondary
241+
requeueForResync, replicationErr = r.resyncVolume(instance, logger, volumeHandle, replicationHandle, parameters, secret)
245242
}
246243

247244
case replicationv1alpha1.Resync:

0 commit comments

Comments
 (0)