Skip to content

fix(controller): try to cause less update conflicts#278

Open
nobbs wants to merge 3 commits intopeak-scale:mainfrom
nobbs:fix/do-not-cause-update-conflicts
Open

fix(controller): try to cause less update conflicts#278
nobbs wants to merge 3 commits intopeak-scale:mainfrom
nobbs:fix/do-not-cause-update-conflicts

Conversation

@nobbs
Copy link
Copy Markdown

@nobbs nobbs commented Dec 3, 2025

I've run into quite a lot of reconcile errors caused by conflicts in the resource to be updated, filling logs with errors like

the object has been modified; please apply your changes to the latest version and try again

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 ArgoTranslator resources, 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:

  • Changed the SyncFinalizerStatus method in ArgoTranslator to return a boolean indicating if the finalizer status was modified, and to only update the finalizer when necessary.
  • Updated the Reconcile method in controller.go to only call Client.Update if the finalizer status was actually changed, reducing unnecessary updates.

Status Update Reliability:

  • In controller_appproject.go, refactored the status update logic to fetch the current ArgoTranslator object 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant