Plugin/Kubernetes: Service and Endpoint Indexing (#1149)

* indexing

* corrections
This commit is contained in:
Sandeep Rajan 2017-10-17 21:30:54 -04:00 committed by John Belamaric
parent 0c63248a0e
commit b6b05eae8f
10 changed files with 501 additions and 26 deletions

View file

@ -35,7 +35,7 @@ func (k *Kubernetes) serviceRecordForIP(ip, name string) []msg.Service {
}
}
// If no cluster ips match, search endpoints
for _, ep := range k.APIConn.EndpointsList() {
for _, ep := range k.APIConn.EpIndexReverse(ip) {
if (len(k.Namespaces) > 0) && !k.namespaceExposed(ep.ObjectMeta.Namespace) {
continue
}