aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.75k stars 585 forks source link

Optimize Cloud Discovery #325

Closed mormamn closed 4 years ago

mormamn commented 4 years ago

Description

Switched get_cloud() to a lazy load, using cached_property. Now only when you access event.cloud it will load what cloud it is.

Contribution Guidelines

Please Read through the Contribution Guidelines.

Fixed Issues

Resolves #324

"BEFORE" and "AFTER" output

Output shouldnt be different

Contribution checklist

codecov-io commented 4 years ago

Codecov Report

Merging #325 into master will increase coverage by 0.34%. The diff coverage is 65.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
+ Coverage   59.56%   59.90%   +0.34%     
==========================================
  Files          41       41              
  Lines        1939     1943       +4     
==========================================
+ Hits         1155     1164       +9     
+ Misses        784      779       -5     
Impacted Files Coverage Δ
kube_hunter/modules/discovery/hosts.py 73.72% <28.57%> (+4.19%) :arrow_up:
kube_hunter/core/events/types/common.py 82.14% <81.25%> (-0.52%) :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 e7585f4...2fe1e0b. Read the comment docs.