-
Notifications
You must be signed in to change notification settings - Fork 120
Fix reconciliation loops #1996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reconciliation loops #1996
Conversation
- Add SyncStatus and APIStatus structs with dedicated phase enums - Implement phase derivation logic treating SyncPhaseIdle as valid for Ready state - Update status collector to handle nested status fields with batched updates - Fix infinite reconciliation loops by making sync manager status-aware - Add conditional status updates to prevent unnecessary Kubernetes API calls - Include comprehensive test suite covering all phase derivation scenarios - Maintain backward compatibility with deprecated top-level sync fields - Update printer columns to show separate sync and API phases 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Daniele Martinoli <[email protected]> Co-authored-by: Claude <[email protected]>
…er to use new SyncStatus structure - Removed deprecated fields: LastSyncTime, LastSyncHash, and ServerCount from MCPRegistryStatus for cleaner API. - Updated the sync manager to return a new Result struct containing sync details. - Adjusted status collector and controller logic to utilize the new SyncStatus fields. - Ensured backward compatibility by removing deprecated fields from CRD definitions. This change enhances the clarity of the MCPRegistry status management and aligns with the recent restructuring of status fields. Signed-off-by: Daniele Martinoli <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1996 +/- ##
==========================================
- Coverage 47.42% 47.27% -0.15%
==========================================
Files 232 232
Lines 28644 28915 +271
==========================================
+ Hits 13583 13671 +88
- Misses 14039 14226 +187
+ Partials 1022 1018 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Removed commented-out success reason constants from the sync manager for clarity. - Cleaned up deployment.yaml by removing unnecessary conditional blocks. These changes streamline the codebase and improve readability. Signed-off-by: Daniele Martinoli <[email protected]>
…he file for consistency. Signed-off-by: Daniele Martinoli <[email protected]>
…he file for consistency. Signed-off-by: Daniele Martinoli <[email protected]>
…at the end of the file for consistency. Signed-off-by: Daniele Martinoli <[email protected]>
…and removing an unnecessary newline at the end of the file. Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only place where I feel like we should improve the code is the nil
dereference, the others are nits that can be fixed later.
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
Fix #1916
Note: The issue became even more relevant with the introduction of the Registry API, because a single
phase
field was trying con condense the reconciliation state of both the sync and API deployment processes. By dividing the phase in 2 distinct fields we can ensure consistent execution of the needed steps and skip those already completed.🤖 Generated with Claude Code