plugin/kubernetes: fix pod insecure mode (#1354)

Fixes #1331
This commit is contained in:
Miek Gieben
2018-01-06 15:56:54 +00:00
committed by GitHub
parent a8e268e33b
commit 75a8a17da4
3 changed files with 36 additions and 2 deletions

View File

@@ -321,6 +321,12 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service,
if !wildcard(namespace) && !k.namespace(namespace) { // no wildcard, but namespace does not exist
return nil, errNoItems
}
// If ip does not parse as an IP address, we return an error, otherwise we assume a CNAME and will try to resolve it in backend_lookup.go
if net.ParseIP(ip) == nil {
return nil, errNoItems
}
return []msg.Service{{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl}}, err
}