-
Notifications
You must be signed in to change notification settings - Fork 49
fix: recreate application in managed mode upon deletion from spoke #605
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
base: main
Are you sure you want to change the base?
Conversation
2c71774 to
0c49341
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #605 +/- ##
==========================================
+ Coverage 45.41% 45.48% +0.07%
==========================================
Files 90 90
Lines 9907 9915 +8
==========================================
+ Hits 4499 4510 +11
+ Misses 4949 4944 -5
- Partials 459 461 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Rizwana777 Can you please pull the latest updates from main? Hopefully, that should fix the e2e tests. |
principal/event.go
Outdated
| // In managed mode, if the application was deleted from the agent but the principal | ||
| // application is not in deletion state, we should recreate it by sending the | ||
| // application spec back to the managed agent | ||
| logCtx.Info("Recreating application in managed agent to maintain desired state") |
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.
We maintain a cache of the desired state app spec on the agent. Can we use that to revert the deletion?
Ref: #567
Also, some of these methods are being refactored to avoid duplication here #596
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.
I will update this logic
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.
@Rizwana777 #596 has been merged
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.
Thanks @chetan-rns I will modify my PR accordingly
3cde9b8 to
2857853
Compare
2857853 to
d570ada
Compare
7a1ad7a to
e909e73
Compare
Assisted-by: Cursor Signed-off-by: Rizwana777 <[email protected]>
Assisted-by: Cursor Signed-off-by: Rizwana777 <[email protected]>
e909e73 to
59188ab
Compare
|
|
||
| t.Log("Verify application is deleted from managed agent") | ||
| requires.Eventually(func() bool { | ||
| app := argoapp.Application{} |
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.
This check may not always pass. What if the app gets recreated before we reach this check?
| // 1. A managed application exists on both principal and managed agent | ||
| // 2. The application is directly deleted from the managed agent (while agent is running) | ||
| // 3. The agent should detect this unauthorized deletion and recreate the application automatically | ||
| func (suite *ResyncTestSuite) Test_ManagedAppRecreationOnDirectDeletion() { |
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.
Can we move this test to appcache_test.go? We have all the revert-based tests in that file. For example, here's a similar test for the autonomous agent https://github.com/argoproj-labs/argocd-agent/blob/main/test/e2e/appcache_test.go#L235
What does this PR do / why we need it:
Application was not recreating when deleted from managed mode even though Principal is not in deletion state, In this fix application is recreating immediately once it is deleted from managed mode
Which issue(s) this PR fixes:
Fixes #?
https://issues.redhat.com/browse/GITOPS-7836
How to test changes / Special notes to the reviewer:
Checklist