mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	middleware/kubernetes: fix aaaa response (#780)
* fix aaaa response * unit tests
This commit is contained in:
		
				
					committed by
					
						 John Belamaric
						John Belamaric
					
				
			
			
				
	
			
			
			
						parent
						
							81315b0b3b
						
					
				
				
					commit
					58006cf847
				
			| @@ -57,7 +57,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M | ||||
| 				path = strings.Join(dns.SplitDomainName(path)[1:], ".") | ||||
| 				newstate := state.NewWithQuestion(strings.Join([]string{name, path}, "."), state.QType()) | ||||
| 				records, extra, _, err = k.routeRequest(zone, newstate) | ||||
| 				if !k.IsNameError(err) { | ||||
| 				if !k.IsNameError(err) && len(records) > 0 { | ||||
| 					records = append(records, nil) | ||||
| 					copy(records[1:], records) | ||||
| 					records[0] = newCNAME(origQName, records[0].Header().Name, records[0].Header().Ttl) | ||||
| @@ -79,7 +79,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M | ||||
| 			// Search . in this middleware | ||||
| 			newstate := state.NewWithQuestion(strings.Join([]string{name, "."}, ""), state.QType()) | ||||
| 			records, extra, _, err = k.routeRequest(zone, newstate) | ||||
| 			if !k.IsNameError(err) { | ||||
| 			if !k.IsNameError(err) && len(records) > 0 { | ||||
| 				records = append(records, nil) | ||||
| 				copy(records[1:], records) | ||||
| 				records[0] = newCNAME(origQName, records[0].Header().Name, records[0].Header().Ttl) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user