Commit 9b8ee1c1 authored by Chris O'Haver's avatar Chris O'Haver Committed by GitHub

plugin/k8s: fix endpoint index creation (#1222)

parent a78f46fb
......@@ -145,11 +145,17 @@ func epNameNamespaceIndexFunc(obj interface{}) ([]string, error) {
}
func epIPIndexFunc(obj interface{}) ([]string, error) {
ep, ok := obj.(*api.EndpointAddress)
ep, ok := obj.(*api.Endpoints)
if !ok {
return nil, errors.New("obj was not an *api.EndpointAddress")
return nil, errors.New("obj was not an *api.Endpoints")
}
var idx []string
for _, eps := range ep.Subsets {
for _, addr := range eps.Addresses {
idx = append(idx, addr.IP)
}
}
return []string{ep.IP}, nil
return idx, nil
}
func serviceListFunc(c *kubernetes.Clientset, ns string, s *labels.Selector) func(meta.ListOptions) (runtime.Object, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment