fix(controller): try to cause less update conflicts#278
Open
nobbs wants to merge 3 commits intopeak-scale:mainfrom
Open
fix(controller): try to cause less update conflicts#278nobbs wants to merge 3 commits intopeak-scale:mainfrom
nobbs wants to merge 3 commits intopeak-scale:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've run into quite a lot of reconcile errors caused by conflicts in the resource to be updated, filling logs with errors like
This PR tries to fix, or at least reduce the number of caused conflicts by trying to be as close to the live resource as possible.
Copilot generated summary
This pull request refactors how status updates and finalizer synchronization are handled for
ArgoTranslatorresources, improving reliability and correctness during concurrent updates. The main changes focus on ensuring that status updates and finalizer modifications are performed safely and only when necessary, using deep copies and conflict-aware operations.Finalizer and Status Synchronization Improvements:
SyncFinalizerStatusmethod inArgoTranslatorto return a boolean indicating if the finalizer status was modified, and to only update the finalizer when necessary.Reconcilemethod incontroller.goto only callClient.Updateif the finalizer status was actually changed, reducing unnecessary updates.Status Update Reliability:
controller_appproject.go, refactored the status update logic to fetch the currentArgoTranslatorobject from the API, copy the new status into it, and then perform the status update. This ensures updates are conflict-aware and prevents overwriting concurrent changes.