mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
use keys (#2167)
This commit is contained in:
committed by
John Belamaric
parent
8432f14207
commit
974ed086f2
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user