diff options
author | 2018-03-13 03:06:03 -0400 | |
---|---|---|
committer | 2018-03-13 07:06:03 +0000 | |
commit | 0daa03a81f87088afe9f3e8eb9aa8341acd9c65b (patch) | |
tree | 8538f9decb83c2babe2eb91f7b47e2dd56fd4fb7 /plugin | |
parent | 259df3c850f9fc892c11b1e6a2adcd0f633e49ae (diff) | |
download | coredns-0daa03a81f87088afe9f3e8eb9aa8341acd9c65b.tar.gz coredns-0daa03a81f87088afe9f3e8eb9aa8341acd9c65b.tar.zst coredns-0daa03a81f87088afe9f3e8eb9aa8341acd9c65b.zip |
exclude terminating pods (#1602)
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/kubernetes/kubernetes.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 34dd47254..da1625c54 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -351,6 +351,11 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, continue } + // exclude pods in the process of termination + if !p.ObjectMeta.DeletionTimestamp.IsZero() { + continue + } + // check for matching ip and 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} |