mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	This reverts commit f4f0d55dce.
Signed-off-by: Adrian Moisey <adrian@changeover.za.net>
			
			
This commit is contained in:
		| @@ -44,13 +44,8 @@ func (k *Kubernetes) serviceRecordForIP(ip, name string) []msg.Service { | ||||
| 		} | ||||
| 		for _, eps := range ep.Subsets { | ||||
| 			for _, addr := range eps.Addresses { | ||||
| 				// The endpoint's Hostname will be set if this endpoint is supposed to generate a PTR. | ||||
| 				// So only return reverse records that match the IP AND have a non-empty hostname. | ||||
| 				// Kubernetes more or less keeps this to one canonical service/endpoint per IP, but in the odd event there | ||||
| 				// are multiple endpoints for the same IP with hostname set, return them all rather than selecting one | ||||
| 				// arbitrarily. | ||||
| 				if addr.IP == ip && addr.Hostname != "" { | ||||
| 					domain := strings.Join([]string{addr.Hostname, ep.Index, Svc, k.primaryZone()}, ".") | ||||
| 				if addr.IP == ip { | ||||
| 					domain := strings.Join([]string{endpointHostname(addr, k.endpointNameMode), ep.Index, Svc, k.primaryZone()}, ".") | ||||
| 					svcs = append(svcs, msg.Service{Host: domain, TTL: k.ttl}) | ||||
| 				} | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user