@@ -388,24 +388,6 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
388388 return ctrl.Result {}, nil
389389}
390390
391- func (r * VolumeReplicationReconciler ) updateReplicationStatus (
392- ctx context.Context ,
393- instance * replicationv1alpha1.VolumeReplication ,
394- logger logr.Logger ,
395- state replicationv1alpha1.State ,
396- message string ) error {
397- instance .Status .State = state
398- instance .Status .Message = message
399- instance .Status .ObservedGeneration = instance .Generation
400- if err := r .Client .Status ().Update (ctx , instance ); err != nil {
401- logger .Error (err , "failed to update status" )
402-
403- return err
404- }
405-
406- return nil
407- }
408-
409391// SetupWithManager sets up the controller with the Manager.
410392func (r * VolumeReplicationReconciler ) SetupWithManager (mgr ctrl.Manager , cfg * config.DriverConfig ) error {
411393 err := r .waitForCrds ()
@@ -445,6 +427,24 @@ func (r *VolumeReplicationReconciler) SetupWithManager(mgr ctrl.Manager, cfg *co
445427 WithEventFilter (pred ).Complete (r )
446428}
447429
430+ func (r * VolumeReplicationReconciler ) updateReplicationStatus (
431+ ctx context.Context ,
432+ instance * replicationv1alpha1.VolumeReplication ,
433+ logger logr.Logger ,
434+ state replicationv1alpha1.State ,
435+ message string ) error {
436+ instance .Status .State = state
437+ instance .Status .Message = message
438+ instance .Status .ObservedGeneration = instance .Generation
439+ if err := r .Client .Status ().Update (ctx , instance ); err != nil {
440+ logger .Error (err , "failed to update status" )
441+
442+ return err
443+ }
444+
445+ return nil
446+ }
447+
448448func (r * VolumeReplicationReconciler ) waitForCrds () error {
449449 logger := r .Log .WithName ("checkingDependencies" )
450450
@@ -665,8 +665,8 @@ func (r *VolumeReplicationReconciler) enableReplication(logger logr.Logger, repl
665665
666666// getVolumeContentSource is a helper function to process provisioning requests that include a DataSource
667667// currently we provide Snapshot and PVC, the default case allows the provisioner to still create a volume
668- // so that an external controller can act upon it. Additional DataSource types can be added here with
669- // an appropriate implementation function
668+ // so that an external controller can act upon it. Additional DataSource types can be added here with
669+ // an appropriate implementation function.
670670func (r * VolumeReplicationReconciler ) getReplicationSource (logger logr.Logger , kind string , volumeHandle string ) (* replicationlib.ReplicationSource , error ) {
671671 switch kind {
672672 case pvcDataSource :
0 commit comments