plugin/kubernetes: fix metadata (#3642)

Automatically submitted.
This commit is contained in:
Chris O'Haver 2020-01-31 14:35:22 -05:00 committed by GitHub
parent f77c6e55bf
commit c9d567ab44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View file

@ -2,8 +2,6 @@ package kubernetes
import (
"github.com/coredns/coredns/plugin/pkg/dnsutil"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
)
@ -26,7 +24,7 @@ type recordRequest struct {
// parseRequest parses the qname to find all the elements we need for querying k8s. Anything
// that is not parsed will have the wildcard "*" value (except r.endpoint).
// Potential underscores are stripped from _port and _protocol.
func parseRequest(state request.Request) (r recordRequest, err error) {
func parseRequest(name, zone string) (r recordRequest, err error) {
// 3 Possible cases:
// 1. _port._protocol.service.namespace.pod|svc.zone
// 2. (endpoint): endpoint.service.namespace.pod|svc.zone
@ -34,7 +32,7 @@ func parseRequest(state request.Request) (r recordRequest, err error) {
//
// Federations are handled in the federation plugin. And aren't parsed here.
base, _ := dnsutil.TrimZone(state.Name(), state.Zone)
base, _ := dnsutil.TrimZone(name, zone)
// return NODATA for apex queries
if base == "" || base == Svc || base == Pod {
return r, nil