contour
contour copied to clipboard
internal/status: Avoid meaningless Condition changes
No longer automatically perform a Status update on any call to AddCondition.
I recently noticed in my cluster that my HTTPRoute objects had updates to status.parents.conditions[Valid].LastTransitionTime once per second. In turn, this triggered my own reconcilers to check out the changes, adding load to the cluster and churn on etcd.
I could see an argument for updating the anonymous function in RouteConditionsAccessor in cache.go instead of AddCondition -- I don't have a strong feeling one way or the other.
Codecov Report
Merging #4607 (754f522) into main (408b470) will decrease coverage by
0.03%. The diff coverage is50.00%.
:exclamation: Current head 754f522 differs from pull request most recent head 01975a7. Consider uploading reports for the commit 01975a7 to get more accurate results
@@ Coverage Diff @@
## main #4607 +/- ##
==========================================
- Coverage 76.81% 76.77% -0.04%
==========================================
Files 140 140
Lines 12993 12997 +4
==========================================
- Hits 9980 9978 -2
- Misses 2751 2756 +5
- Partials 262 263 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| internal/status/routeconditions.go | 22.22% <50.00%> (+1.63%) |
:arrow_up: |
| internal/sorter/sorter.go | 96.38% <0.00%> (-2.41%) |
:arrow_down: |
/hold
I'm not sure that this is working; I tried applying it to my cluster (I might have screwed that up), but I'm still seeing condition updates.
The change makes sense to me, seems like it should be more efficient. I'll wait for @evankanderson to update before pushing the approve button though.
Marking this PR stale since there has been no activity for 14 days. It will be closed if there is no activity for another 30 days.
ping @evankanderson - do you still want to go ahead here?
Marking this PR stale since there has been no activity for 14 days. It will be closed if there is no activity for another 30 days.