use keys (#2167)
This commit is contained in:
parent
8432f14207
commit
974ed086f2
13 changed files with 291 additions and 380 deletions
|
@ -28,14 +28,18 @@ func (k *Kubernetes) localNodeName() string {
|
|||
}
|
||||
|
||||
// Find endpoint matching localIP
|
||||
for _, ep := range k.APIConn.EpIndexReverse(localIP.String()) {
|
||||
for _, eps := range ep.Subsets {
|
||||
for _, addr := range eps.Addresses {
|
||||
if localIP.Equal(net.ParseIP(addr.IP)) {
|
||||
return addr.NodeName
|
||||
}
|
||||
ep := k.APIConn.EpIndexReverse(localIP.String())
|
||||
if ep == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, eps := range ep.Subsets {
|
||||
for _, addr := range eps.Addresses {
|
||||
if localIP.Equal(net.ParseIP(addr.IP)) {
|
||||
return addr.NodeName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue