Commit 70f2bd1d authored by Chris O'Haver's avatar Chris O'Haver Committed by Miek Gieben

dont duplicate service recrod for every port (#3240)

parent acabfc5e
...@@ -110,14 +110,15 @@ func (k *Kubernetes) transfer(c chan dns.RR, zone string) { ...@@ -110,14 +110,15 @@ func (k *Kubernetes) transfer(c chan dns.RR, zone string) {
case api.ServiceTypeClusterIP, api.ServiceTypeNodePort, api.ServiceTypeLoadBalancer: case api.ServiceTypeClusterIP, api.ServiceTypeNodePort, api.ServiceTypeLoadBalancer:
clusterIP := net.ParseIP(svc.ClusterIP) clusterIP := net.ParseIP(svc.ClusterIP)
if clusterIP != nil { if clusterIP != nil {
for _, p := range svc.Ports { s := msg.Service{Host: svc.ClusterIP, TTL: k.ttl}
s.Key = strings.Join(svcBase, "/")
s := msg.Service{Host: svc.ClusterIP, Port: int(p.Port), TTL: k.ttl} // Change host from IP to Name for SRV records
s.Key = strings.Join(svcBase, "/") host := emitAddressRecord(c, s)
// Change host from IP to Name for SRV records for _, p := range svc.Ports {
host := emitAddressRecord(c, s) s := msg.Service{Host: host, Port: int(p.Port), TTL: k.ttl}
s.Host = host s.Key = strings.Join(svcBase, "/")
// Need to generate this to handle use cases for peer-finder // Need to generate this to handle use cases for peer-finder
// ref: https://github.com/coredns/coredns/pull/823 // ref: https://github.com/coredns/coredns/pull/823
......
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