Closed danielsagi closed 3 years ago
Merging #448 (dd61318) into main (1a26653) will increase coverage by
0.36%
. The diff coverage is90.24%
.
@@ Coverage Diff @@
## main #448 +/- ##
==========================================
+ Coverage 63.67% 64.04% +0.36%
==========================================
Files 42 42
Lines 2296 2350 +54
==========================================
+ Hits 1462 1505 +43
- Misses 834 845 +11
Impacted Files | Coverage Δ | |
---|---|---|
kube_hunter/core/events/handler.py | 90.54% <89.33%> (-0.55%) |
:arrow_down: |
kube_hunter/core/events/types.py | 83.60% <100.00%> (+0.99%) |
:arrow_up: |
kube_hunter/modules/hunting/apiserver.py | 70.41% <0.00%> (-1.93%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1a26653...dd61318. Read the comment docs.
Multiple Subscriptions
A continuation for this old PR #271 When an hunter needs several prerequisites to exist in the cluster, We need to register for multiple events. This new mechanism allows us to execute once for every new combination of specified required events. For example: let a C hunter be registered to event A and B
The hunter will execute 2 times:
This allows us to run specific hunters multiple times with updated data, only when a minimum set of different events are published.
Practical Changes
This PR Adds:
@handler.subscribe_many()
[Event1, Event2]
MultipleEventsContainer
which is passed to a hunter which subscribes usingsubscribe_many
get_by_class
method, to get specific events from the container.Example can be seen in added Tests
Fixed Issues
144
Contribution checklist