Skip to content

Commit eebba4d

Browse files
committed
fix: accomodate for pending pods with no IP address in network fault
Signed-off-by: smit thakkar <[email protected]>
1 parent 6992748 commit eebba4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

chaoslib/litmus/network-chaos/lib/network-chaos.go

+3
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ func getPodIPFromService(host string, clients clients.ClientSets) ([]string, err
358358
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())}
359359
}
360360
for _, p := range pods.Items {
361+
if p.Status.PodIP == "" {
362+
continue
363+
}
361364
ips = append(ips, p.Status.PodIP)
362365
}
363366

0 commit comments

Comments
 (0)