mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
18
middleware/kubernetes/autopath.go
Normal file
18
middleware/kubernetes/autopath.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user