Only pods in running phase are vallid for status (#2093)
This commit is contained in:
parent
1f79333789
commit
9bb9011e57
3 changed files with 37 additions and 0 deletions
|
|
@ -260,6 +260,11 @@ func (s *statusSync) runningAddresses() ([]string, error) {
|
|||
}
|
||||
|
||||
for _, pod := range pods.Items {
|
||||
// only Running pods are valid
|
||||
if pod.Status.Phase != apiv1.PodRunning {
|
||||
continue
|
||||
}
|
||||
|
||||
name := k8s.GetNodeIPOrName(s.Client, pod.Spec.NodeName, s.UseNodeInternalIP)
|
||||
if !sliceutils.StringInSlice(name, addrs) {
|
||||
addrs = append(addrs, name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue