Skip to content

Commit

Permalink
replication: update LastSyncTime if its not nill
Browse files Browse the repository at this point in the history
LastSyncTime can be optional and nil also, there
is no strict check for it and if we dont have this
check the default UNIX time will get added to the
CR which doesnt make sense. If the time is not
present keeping the last known LastSyncTime itself.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 authored and mergify[bot] committed Nov 2, 2022
1 parent cfe1553 commit 822086e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
return ctrl.Result{}, err
}
ts := info.GetLastSyncTime()

lastSyncTime := metav1.NewTime(ts.AsTime())
instance.Status.LastSyncTime = &lastSyncTime
if ts != nil {
lastSyncTime := metav1.NewTime(ts.AsTime())
instance.Status.LastSyncTime = &lastSyncTime
}
requeueForInfo = true
}
if instance.Spec.ReplicationState == replicationv1alpha1.Secondary {
Expand Down

0 comments on commit 822086e

Please sign in to comment.