Skip to content

enhance: Remove docker acquis internal timer use docker events #3598

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

Merged

Conversation

LaurenceJJones
Copy link
Contributor

Instead of polling the api every one second, we can instead use the events hook in docker this is a continuous event stream that notify us of a container event. We filter for start and die which is crate and remove, to which we then trigger a function call to get all containers and update the state.

This means this should be less intensive since we dont have to constantly poll for all containers and only do so when we actually get a notification to do so.

Copy link

@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@LaurenceJJones
Copy link
Contributor Author

/kind enhancement
/area agent

Copy link

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 43.96552% with 65 lines in your changes missing coverage. Please review.

Project coverage is 60.81%. Comparing base (5fe038d) to head (35e9e62).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/acquisition/modules/docker/docker.go 43.96% 60 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3598      +/-   ##
==========================================
- Coverage   60.82%   60.81%   -0.02%     
==========================================
  Files         372      372              
  Lines       40841    40917      +76     
==========================================
+ Hits        24843    24885      +42     
- Misses      13943    13979      +36     
+ Partials     2055     2053       -2     
Flag Coverage Δ
bats 44.57% <0.00%> (-0.05%) ⬇️
unit-linux 34.37% <43.96%> (+<0.01%) ⬆️
unit-windows 24.33% <43.96%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LaurenceJJones LaurenceJJones added this to the 1.6.9 milestone Apr 30, 2025
@mmetc
Copy link
Contributor

mmetc commented May 19, 2025

@LaurenceJJones let me know what you think of my change, I didn't test in docker but the only difference should be that it's applied to the initial connection.

@buixor buixor requested a review from blotus May 20, 2025 07:36
Copy link
Contributor

@sabban sabban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@LaurenceJJones LaurenceJJones merged commit 818974e into crowdsecurity:master May 22, 2025
15 of 16 checks passed
@LaurenceJJones LaurenceJJones deleted the remove_docker_internal_ticker branch May 22, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants