mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	Stop looking at the qtype in parseRequest and make k.Namespace a map. Fallout from this is that pkg/strings as it is not used anymore. Also add a few helper functions to make unexposed namespaces easier to see in the code. Add wildcard tests to the middleware tests.
		
			
				
	
	
		
			21 lines
		
	
	
		
			571 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			571 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package kubernetes
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/coredns/coredns/middleware"
 | 
						|
	"github.com/coredns/coredns/middleware/etcd/msg"
 | 
						|
	"github.com/coredns/coredns/middleware/pkg/dnsutil"
 | 
						|
	"github.com/coredns/coredns/request"
 | 
						|
)
 | 
						|
 | 
						|
// Reverse implements the ServiceBackend interface.
 | 
						|
func (k *Kubernetes) Reverse(state request.Request, exact bool, opt middleware.Options) ([]msg.Service, []msg.Service, error) {
 | 
						|
 | 
						|
	ip := dnsutil.ExtractAddressFromReverse(state.Name())
 | 
						|
	if ip == "" {
 | 
						|
		return nil, nil, nil
 | 
						|
	}
 | 
						|
 | 
						|
	records := k.serviceRecordForIP(ip, state.Name())
 | 
						|
	return records, nil, nil
 | 
						|
}
 |