remove wildcard query functionality (#5019)

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2022-02-09 09:25:10 -05:00 committed by GitHub
parent 40a526b27f
commit abaf938623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 178 deletions

View file

@ -24,11 +24,7 @@ func (k *Kubernetes) External(state request.Request) ([]msg.Service, int) {
// We are dealing with a fairly normal domain name here, but we still need to have the service
// and the namespace:
// service.namespace.<base>
//
// for service (and SRV) you can also say _tcp, and port (i.e. _http), we need those be picked
// up, unless they are not specified, then we use an internal wildcard.
port := "*"
protocol := "*"
var port, protocol string
namespace := segs[last]
if !k.namespaceExposed(namespace) {
return nil, dns.RcodeNameError
@ -69,7 +65,7 @@ func (k *Kubernetes) External(state request.Request) ([]msg.Service, int) {
for _, ip := range svc.ExternalIPs {
for _, p := range svc.Ports {
if !(match(port, p.Name) && match(protocol, string(p.Protocol))) {
if !(matchPortAndProtocol(port, p.Name, protocol, string(p.Protocol))) {
continue
}
rcode = dns.RcodeSuccess