Commit 0daa03a8 authored by Chris O'Haver's avatar Chris O'Haver Committed by Miek Gieben

exclude terminating pods (#1602)

parent 259df3c8
...@@ -351,6 +351,11 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, ...@@ -351,6 +351,11 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service,
continue continue
} }
// exclude pods in the process of termination
if !p.ObjectMeta.DeletionTimestamp.IsZero() {
continue
}
// check for matching ip and namespace // check for matching ip and namespace
if ip == p.Status.PodIP && match(namespace, p.Namespace) { if ip == p.Status.PodIP && match(namespace, p.Namespace) {
s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl} s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl}
......
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