diff options
author | 2017-11-15 14:06:37 +0000 | |
---|---|---|
committer | 2017-11-15 14:06:37 +0000 | |
commit | 621dd36f6d67a1be4549f6d70aa6e787326e274b (patch) | |
tree | 8bd2ee52a37cc93b1a6efa64564111e68fb83132 /plugin/kubernetes/kubernetes.go | |
parent | 99dd8f99f3f95e7000c5aac32701b2d0432b35bd (diff) | |
download | coredns-621dd36f6d67a1be4549f6d70aa6e787326e274b.tar.gz coredns-621dd36f6d67a1be4549f6d70aa6e787326e274b.tar.zst coredns-621dd36f6d67a1be4549f6d70aa6e787326e274b.zip |
plugin/kubernetes: set TTL on pod responses (#1239)
The TTL was still zero, instead it should adhere to the k.ttl setting.
Change this and update tests to match.
Diffstat (limited to 'plugin/kubernetes/kubernetes.go')
-rw-r--r-- | plugin/kubernetes/kubernetes.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 0168ab52a..d8b27d42d 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -320,7 +320,7 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, } if k.podMode == podModeInsecure { - return []msg.Service{{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip}}, nil + return []msg.Service{{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl}}, nil } // PodModeVerified @@ -331,7 +331,7 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, } // 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} + s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl} pods = append(pods, s) err = nil |