Skip to content

Commit 026e764

Browse files
authored
Centralize synced condition handling inside ensureConditions method (#77)
Description of changes: * Since `ACK.ResourceSynced` condition is now handled inside `ensureConditions` so we do not need to explicitly set `ACK.ResourceSynced` condition as `True` when there is no delta between desired and latest spec. * This will fix the bug when `ACK.ResourceSynced` condition should be determined using `rm.IsSynced` method inside `ensureConditions`, but `updateResource` prematurely sets the `ACK.ResourceSynced` condition to true due to no delta between desired & latest Spec and `ensureConditions` method does not override the condition. * ensureConditions method does not override the Synced condition status because there are still many controllers that set the Synced condition using custom hooks. * No unit-test changes needed. Existing test covers this case. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 6d627c9 commit 026e764

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

pkg/runtime/reconciler.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,6 @@ func (r *resourceReconciler) updateResource(
440440
return latest, err
441441
}
442442
rlog.Info("updated resource")
443-
} else {
444-
// If there is no delta between desired state and latest state, and
445-
// ACK.ResourceSynced condition is not already set, it is
446-
// safe to set ACK.ResourceSynced condition to true.
447-
if ackcondition.Synced(latest) == nil {
448-
ackcondition.SetSynced(latest, corev1.ConditionTrue, nil, nil)
449-
}
450443
}
451444
return latest, nil
452445
}

0 commit comments

Comments
 (0)