Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin/kubernetes: Don't duplicate service records in zone transfer #3240

Merged
merged 1 commit into from Sep 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions plugin/kubernetes/xfr.go
Expand Up @@ -110,14 +110,15 @@ func (k *Kubernetes) transfer(c chan dns.RR, zone string) {
case api.ServiceTypeClusterIP, api.ServiceTypeNodePort, api.ServiceTypeLoadBalancer:
clusterIP := net.ParseIP(svc.ClusterIP)
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}
s.Key = strings.Join(svcBase, "/")
// Change host from IP to Name for SRV records
host := emitAddressRecord(c, s)

// Change host from IP to Name for SRV records
host := emitAddressRecord(c, s)
s.Host = host
for _, p := range svc.Ports {
s := msg.Service{Host: host, Port: int(p.Port), TTL: k.ttl}
s.Key = strings.Join(svcBase, "/")

// Need to generate this to handle use cases for peer-finder
// ref: https://github.com/coredns/coredns/pull/823
Expand Down