WIP: autopath as middleware (#859)

autopath as middleware
This commit is contained in:
Miek Gieben 2017-08-09 03:13:38 -07:00 committed by GitHub
parent c3705ec68c
commit b46b9880bd
20 changed files with 597 additions and 642 deletions

View file

@ -0,0 +1,18 @@
package kubernetes
import "k8s.io/client-go/1.5/pkg/api"
// TODO(miek): rename and put in autopath.go file. This will be for the
// external middleware autopath to use. Mostly to get the namespace:
//name, path, ok := autopath.SplitSearch(zone, state.QName(), p.Namespace)
func (k *Kubernetes) findPodWithIP(ip string) (p *api.Pod) {
objList := k.APIConn.PodIndex(ip)
for _, o := range objList {
p, ok := o.(*api.Pod)
if !ok {
return nil
}
return p
}
return nil
}