Skip to content

Commit

Permalink
fix: accomodate for pending pods with no IP address in network fault
Browse files Browse the repository at this point in the history
Signed-off-by: smit thakkar <smit.thakkar@deliveryhero.com>
  • Loading branch information
smitthakkar96 committed Jan 22, 2024
1 parent 6992748 commit eebba4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chaoslib/litmus/network-chaos/lib/network-chaos.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ func getPodIPFromService(host string, clients clients.ClientSets) ([]string, err
return ips, cerrors.Error{ErrorCode: cerrors.ErrorTypeGeneric, Target: fmt.Sprintf("{svcName: %s,podLabel: %s, namespace: %s}", svcNs, svcSelector, svcNs), Reason: fmt.Sprintf("failed to derive pods from service: %s", err.Error())}
}
for _, p := range pods.Items {
if p.Status.PodIP == "" {
continue
}
ips = append(ips, p.Status.PodIP)
}

Expand Down

0 comments on commit eebba4d

Please sign in to comment.