Closed efossas closed 3 years ago
@efossas
Thanks for kind words also for bug.
Yes. Look like when I rearrange project moved from global to local variable but somehow missed this. Yes I will fix it tomorrow morning.
Thanks, Yogesh
Patched in new release. closing the issue.
All of my services are returned as unused, as well as ingresses. The issue is this:
When the
GetUsedServices(v1)
function is run, it updates the local variableUsedEP
, not the global variable ofUsedEP
. The global variable remains an empty list and so when the difference is calculated betweenEP
andUsedEP
, the entireEP
list is returned.A simple fix to this is to set
UsedEP
whenGetUsedServices(v1)
is called here: https://github.com/yogeshkk/K8sPurger/blob/main/K8sPurger.py#L44As in, update it to this:
UsedEP = GetUsedServices(v1)
I can create a PR if you want, but because the change is so small, you might want to just fix this yourself.
Great project btw