-
Notifications
You must be signed in to change notification settings - Fork 276
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(server): Application sync fails when CreateNamespace
and ServerSideApply
flags are set in the sync options
#563
Conversation
Signed-off-by: Anand Francis Joseph <[email protected]>
CreateNamespace
and ServerSideApply
flags are set in the sync options
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #563 +/- ##
==========================================
- Coverage 54.47% 54.47% -0.01%
==========================================
Files 41 41
Lines 4793 4795 +2
==========================================
+ Hits 2611 2612 +1
- Misses 1969 1970 +1
Partials 213 213 ☔ View full report in Codecov by Sentry. |
Steps to reproduce the error
The argocd application |
Steps to build the fix
Steps to apply the fix and validate
|
Signed-off-by: Anand Francis Joseph <[email protected]>
@anandf thank you for your PR. Last time when i have fixed this issue argoproj/argo-cd#16177 In high level Could you please confirm that before my changes you were not able reproduce this issue? Because with your change you also going to change how you applying resources and customer even will not know that they doing it with client side apply. Also important to say that this issue was opened before my fix So looks like it is just another not covered case with ServerSideApply Thanks! |
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.
Minor comments.
Otherwise LGTM
Thanks for contributing!
@pasha-codefresh This change will only affect the sync during dryrun with strategy |
Yes, you are right , lgtm |
Signed-off-by: Anand Francis Joseph <[email protected]>
…hadowing Signed-off-by: Anand Francis Joseph <[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.
A did more investigation and I don't think that we should be going in this direction.
Explanation here
Taking a different approach and created a new PR #564 |
Closing in favour of #564 |
Root Cause:
When server side apply is set to true, dry run is run in server mode, if the dry run fails in server mode, then it is re-run in client mode. But the server side apply is still set. This is not a supported configuration in
kubectl
when--dry-run
is set to client,--server-side
flag is not supported.Solution
When
kubectl apply --dry-run=server --server-side
fails, then re-run the dry run in client mode and withserver-side
flag removed as below