Skip to content

Commit 5bd1fc3

Browse files
Nikhil-Ladhamergify[bot]
authored andcommitted
add replicating condition if error returned for volume info call
we should add replicating condition to VR/VGR status if GetVolumeReplicationInfo call returned an error, so that we are able to report the current condition to the user. Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
1 parent bd28a1c commit 5bd1fc3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/controller/replication.storage/volumereplication_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
463463
requeueForInfo = true
464464
} else if !util.IsUnimplementedError(err) {
465465
logger.Error(err, "Failed to get volume replication info")
466+
// Set UNKNOWN Replicating condition if any error occurred while fetching volume info.
467+
setReplicationCondition(vr.instance, vr.instance.Spec.DataSource.Kind, err.Error(), proto.GetVolumeReplicationInfoResponse_UNKNOWN)
468+
statusErr := r.updateReplicationStatus(instance, logger, GetReplicationState(instance.Spec.ReplicationState), msg)
469+
if statusErr != nil {
470+
return ctrl.Result{}, statusErr
471+
}
466472
return ctrl.Result{}, err
467473
}
468474
}

0 commit comments

Comments
 (0)