This repository was archived by the owner on Nov 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
fix(sync): ApplyOutOfSyncOnly=true sync option is not honoured for cluster scoped resources #765
Merged
jannfis
merged 8 commits into
argoproj:master
from
anandf:fix_applyoutofsynconly_issue_for_cluster_resources
Sep 5, 2025
Merged
fix(sync): ApplyOutOfSyncOnly=true sync option is not honoured for cluster scoped resources #765
jannfis
merged 8 commits into
argoproj:master
from
anandf:fix_applyoutofsynconly_issue_for_cluster_resources
Sep 5, 2025
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
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #765 +/- ##
==========================================
- Coverage 54.26% 47.16% -7.11%
==========================================
Files 64 64
Lines 6164 6562 +398
==========================================
- Hits 3345 3095 -250
- Misses 2549 3212 +663
+ Partials 270 255 -15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…OfSyncOnly=true Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
jannfis
reviewed
Aug 27, 2025
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
|
jannfis
approved these changes
Sep 5, 2025
Member
jannfis
left a comment
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.
LGTM
anandf
added a commit
to anandf/gitops-engine
that referenced
this pull request
Sep 5, 2025
…uster scoped resources (argoproj#765) * Using live obj to get the resource key if not nil Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Fixed failing unit tests Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Added test case for validating cluster scoped resources with ApplyOutOfSyncOnly=true Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Fixed gofumpt formatting errors Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Corrected unit tests for cluster scoped resources Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Removed unwanted code comments Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Added comments for explaining the reason why ns is set from live object Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> * Added comments in the unit test Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com> --------- Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
This was referenced Sep 5, 2025
agaudreault
pushed a commit
that referenced
this pull request
Sep 5, 2025
…uster scoped resources (#765) (#776) * Using live obj to get the resource key if not nil * Fixed failing unit tests * Added test case for validating cluster scoped resources with ApplyOutOfSyncOnly=true * Fixed gofumpt formatting errors * Corrected unit tests for cluster scoped resources * Removed unwanted code comments * Added comments for explaining the reason why ns is set from live object * Added comments in the unit test --------- Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Fixes argoproj/argo-cd#24242
The root cause of the issue is, when the
resourceKeyis calculated from the object associated withsyncTask, it is calculated from the desired object instead of the live object. In the desired object, theresourceKeywill be filled in with the destination namespace configured in the Application even for cluster scoped resource, where the namespace must be empty.For fixing the issue, when the
syncTaskcontains aliveObj, calculate theresourceKeyusing the live object instead of the desired object set in thesyncTask. This desired object contains the application destination namespace even for cluster scoped resources.