mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 17:13:22 +00:00
To keep depecrate k8s node NodeLegacyHostIP as local constant to keep compatibility for older k8s version
Signed-off-by: jojohappy <sarahdj0917@gmail.com>
This commit is contained in:
parent
f3735d0ead
commit
e81785d1a3
@ -29,6 +29,10 @@ import (
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
)
|
||||
|
||||
const (
|
||||
NodeLegacyHostIP = "LegacyHostIP"
|
||||
)
|
||||
|
||||
// Node discovers Kubernetes nodes.
|
||||
type Node struct {
|
||||
logger log.Logger
|
||||
@ -203,6 +207,9 @@ func nodeAddress(node *apiv1.Node) (string, map[apiv1.NodeAddressType][]string,
|
||||
if addresses, ok := m[apiv1.NodeExternalIP]; ok {
|
||||
return addresses[0], m, nil
|
||||
}
|
||||
if addresses, ok := m[apiv1.NodeAddressType(NodeLegacyHostIP)]; ok {
|
||||
return addresses[0], m, nil
|
||||
}
|
||||
if addresses, ok := m[apiv1.NodeHostName]; ok {
|
||||
return addresses[0], m, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user