-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
feat: option to disable writing k8s events(#18205) #18441
feat: option to disable writing k8s events(#18205) #18441
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18441 +/- ##
==========================================
+ Coverage 55.81% 55.84% +0.02%
==========================================
Files 320 320
Lines 44396 44430 +34
==========================================
+ Hits 24781 24810 +29
- Misses 17050 17051 +1
- Partials 2565 2569 +4 ☔ View full report in Codecov by Sentry. |
bf515c8
to
1af1404
Compare
@tooptoop4 Can you check on that PR? |
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 for your PR.
However, I feel like this will pollute the command line arguments (and accompanying environment variables) unnecessarily.
Have you considered using a single flag taking a list of events to enable? (i.e. --enable-events=<comma separated list>
), possibly with all
and none
aliases?
@jannfis |
1af1404
to
04e885c
Compare
cmd/argocd-application-controller/commands/argocd_application_controller.go
Outdated
Show resolved
Hide resolved
39e230b
to
3d52314
Compare
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 @Jack-R-lantern !! LGTM!!
@jannfis do you any concerns on the PR?
@jannfis do you any concerns on the PR? Could we please merge as soon as possible? Thanks! |
9f2d5f0
to
bb41454
Compare
@jannfis |
Hi @jannfis, could you please review this PR? We are waiting for this feature and we would like to be merged ASAP. Hope it will make it still to 2.12. Thanks a lot! |
Would love to use this enhancement in the coming release version. |
f12fbe9
to
b95c9f1
Compare
b95c9f1
to
b4f538c
Compare
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 comment rest LGTM
optioned to write logs for k8s events. Each is passed as an environment variable and defaults to true, disabling it requires explicitly setting the option to false. Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
fix unit test - application_test - applicationset_test - project_test - appcontroller_tes - audit_logger_test Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
b4f538c
to
1a57c8b
Compare
@jannfis does the changes look good to you? |
/cherry-pick release-2.13 |
…18441) * feat: option to disable writing k8s events optioned to write logs for k8s events. Each is passed as an environment variable and defaults to true, disabling it requires explicitly setting the option to false. Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * feat: option to disable writing k8s events fix unit test - application_test - applicationset_test - project_test - appcontroller_tes - audit_logger_test Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * rebase Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> --------- Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> Signed-off-by: ratulbasak <ratulbasak93@gmail.com>
@Jack-R-lantern We are unable to find this commit in any release notes. Which version has this change? |
Would you like to check the 2.13.0 version? |
@Jack-R-lantern I checked the code , looks like it is only available in master but not on the tags. ![]() ![]() |
@Jack-R-lantern @tooptoop4 @gdsoumya Can this feature be included in next patch version? I could not find it in latest release. Looks like it was merged to master but not to individual tags. 2.13 does not have this feature. Please correct me if I am wrong. I am using 2.12.4 version. This is a very useful feature for us. Whenever there is a shared resource warning, the applications will be in out-of-sync and sync loop forever which creates thousands of events for few mins. I even tried the "failonsharedresourcewarning" option , it works perfectly for app with manual sync but for auto-sync enabled apps the loop continues. It brought down the etcd . So disabling the events would really help in this case. |
/cherry-pick release-2.13 |
Seems like the automated cherry pick isn't working, @Jack-R-lantern can you raise a cherry pick PR to the release branch |
…18441) * feat: option to disable writing k8s events optioned to write logs for k8s events. Each is passed as an environment variable and defaults to true, disabling it requires explicitly setting the option to false. Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * feat: option to disable writing k8s events fix unit test - application_test - applicationset_test - project_test - appcontroller_tes - audit_logger_test Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * rebase Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> --------- Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
* feat: option to disable writing k8s events optioned to write logs for k8s events. Each is passed as an environment variable and defaults to true, disabling it requires explicitly setting the option to false. --------- Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
…18441) * feat: option to disable writing k8s events optioned to write logs for k8s events. Each is passed as an environment variable and defaults to true, disabling it requires explicitly setting the option to false. Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * feat: option to disable writing k8s events fix unit test - application_test - applicationset_test - project_test - appcontroller_tes - audit_logger_test Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> * rebase Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> --------- Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com> Signed-off-by: Adrian Aneci <aneci@adobe.com>
I wonder why that nice feature not available via configmap argocd-cmd-params-cm as data:
server.enable.k8s.event: none |
Does it work when using environment variable? |
This PR is related to the argocd event logging optionization.
The implementation is on/off depending on the kind of event reason.
Below is a simple example
case all, none, specific
Result
argocd-server env all
argocd-server env none
argocd-server env specific
Close #18205
Checklist: