parent
aba58d67f2
commit
f0f9618a89
2 changed files with 136 additions and 89 deletions
|
|
@ -48,16 +48,20 @@ func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP
|
|||
return ""
|
||||
}
|
||||
|
||||
if useInternalIP {
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeInternalIP {
|
||||
if address.Address != "" {
|
||||
return address.Address
|
||||
}
|
||||
defaultOrInternalIP := ""
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeInternalIP {
|
||||
if address.Address != "" {
|
||||
defaultOrInternalIP = address.Address
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if useInternalIP {
|
||||
return defaultOrInternalIP
|
||||
}
|
||||
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeExternalIP {
|
||||
if address.Address != "" {
|
||||
|
|
@ -66,7 +70,7 @@ func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP
|
|||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
return defaultOrInternalIP
|
||||
}
|
||||
|
||||
// PodInfo contains runtime information about the pod running the Ingres controller
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue