-
Notifications
You must be signed in to change notification settings - Fork 357
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(monitor): add an events channel to avoid event loss caused by delayed docker event processing #1930
base: main
Are you sure you want to change the base?
Conversation
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.
@slashexx Thanks for the PR, rest LGTM, just a few comments from my side. let me know wdyt?
KubeArmor/core/dockerHandler.go
Outdated
@@ -218,10 +218,23 @@ func (dh *DockerHandler) GetContainerInfo(containerID string, OwnerInfo map[stri | |||
// GetEventChannel Function | |||
func (dh *DockerHandler) GetEventChannel() <-chan events.Message { |
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.
let's pass and use the StopChan
to handle the stop signal here and also pass the cancellable context to to dockerclient.
KubeArmor/KubeArmor/core/dockerHandler.go
Line 760 in a5791b5
case <-StopChan: |
types.EventsOptions
has been deprecated in latest, can we handle that as well? 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.
@rksharma95 The required changes have been made, PTAL !
3965d05
to
b660ad1
Compare
@slashexx can you please squash the commits? |
Signed-off-by: slashexx <[email protected]> fix: update event options in Docker event stream to use ListOptions Signed-off-by: slashexx <[email protected]> refactor: remove unused import for Docker API types in dockerHandler Signed-off-by: slashexx <[email protected]> refactor: update GetEventChannel to accept context and stop channel for better event handling Signed-off-by: slashexx <[email protected]>
@rksharma95 commits have been squashed ! |
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 👍
It's been open for a while, gentle ping @Prateeknandle @daemon1024 , is it gtg ? |
Hey @slashexx yep it mostly good to go. We currently have code freeze, only fixing bugs for upcoming stable release. We will start reviewing new PRs again after v1.5.1 release. Appreciate the PR! |
Purpose of PR?:
Fixes #1929
Does this PR introduce a breaking change?
No
If the changes in this PR are manually verified, list down the scenarios covered::
Additional information for reviewer? :
This PR addresses the Docker event queue buffer issue by adding processing logic in dockerHandler.go. It is part of improving KubeArmor's ability to handle high-frequency Docker events efficiently.
Checklist:
<type>(<scope>): <subject>