litmuschaos / litmus-go

Apache License 2.0
66 stars 118 forks source link

fix: accomodate for pending pods with no IP address in network fault #684

Closed smitthakkar96 closed 6 months ago

smitthakkar96 commented 7 months ago

What this PR does / why we need it:

Ignore pods with no IP address, this can be the case if pod is still in pending state. This will help prevent following error when injecting network fault:

{"source":"pod-network-corruption-helper-nrb8b","errorCode":"HELPER_ERROR","phase":"ChaosInject","reason":"failed to create destination ips match filters: Illegal \"match\"\n"}

I was considering getting pod IPs from SVC endpoints; however, the RBAC permissions for Chaos Helper pods don't have access to list endpoints, which would likely become a breaking change. We can consider moving to that approach when we plan to rollout the next major version.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Fixes https://github.com/litmuschaos/litmus/issues/4395

Special notes for your reviewer:

Checklist:

smitthakkar96 commented 7 months ago

@ispeakc0de @uditgaurav @ksatchit can you please take a look?