Only trigger updates when necessary
This commit is contained in:
parent
4c0a7205aa
commit
03b16f5f3c
@ -102,6 +102,11 @@ func (r *BackupSessionReconciler) StatusUpdate() error {
|
|||||||
// The last task failed. We mark the backupsession as failed and we stop here.
|
// The last task failed. We mark the backupsession as failed and we stop here.
|
||||||
log.V(0).Info("last backup task failed. Stop here", "targetStatus", currentTargetStatus)
|
log.V(0).Info("last backup task failed. Stop here", "targetStatus", currentTargetStatus)
|
||||||
r.BackupSession.Status.SessionState = formolv1alpha1.Failure
|
r.BackupSession.Status.SessionState = formolv1alpha1.Failure
|
||||||
|
log.V(1).Info("New BackupSession status", "status", r.BackupSession.Status.SessionState)
|
||||||
|
if err := r.Status().Update(ctx, r.BackupSession); err != nil {
|
||||||
|
log.Error(err, "unable to update BackupSession status")
|
||||||
|
return err
|
||||||
|
}
|
||||||
case formolv1alpha1.Running:
|
case formolv1alpha1.Running:
|
||||||
// The current task is still running. Nothing to do
|
// The current task is still running. Nothing to do
|
||||||
log.V(0).Info("task is still running", "targetStatus", currentTargetStatus)
|
log.V(0).Info("task is still running", "targetStatus", currentTargetStatus)
|
||||||
@ -204,12 +209,12 @@ func (r *BackupSessionReconciler) StatusUpdate() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
log.V(1).Info("New BackupSession status", "status", r.BackupSession.Status.SessionState)
|
log.V(1).Info("New BackupSession status", "status", r.BackupSession.Status.SessionState)
|
||||||
if err := r.Status().Update(ctx, r.BackupSession); err != nil {
|
if err := r.Status().Update(ctx, r.BackupSession); err != nil {
|
||||||
log.Error(err, "unable to update BackupSession status")
|
log.Error(err, "unable to update BackupSession status")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case formolv1alpha1.Deleted:
|
case formolv1alpha1.Deleted:
|
||||||
for _, target := range r.BackupSession.Status.Targets {
|
for _, target := range r.BackupSession.Status.Targets {
|
||||||
if target.SessionState != formolv1alpha1.Deleted {
|
if target.SessionState != formolv1alpha1.Deleted {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user