mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
do the grpc _grpc_config as well
Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -59,7 +59,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
labels := dns.SplitDomainName(cluster)
|
||||
switch len(labels) {
|
||||
case 2:
|
||||
// endpoint or _tcp
|
||||
// endpoint or _tcp or _grpc_config query
|
||||
if strings.ToLower(labels[0]) == "_tcp" {
|
||||
// nodata, because empty non-terminal
|
||||
m.Ns = soa(state.Zone)
|
||||
@@ -67,6 +67,15 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
w.WriteMsg(m)
|
||||
return 0, nil
|
||||
}
|
||||
if strings.HasPrefix(strings.ToLower(labels[0]), "_grpc_config") {
|
||||
// this is the grpc config blob encoded in a TXT record, we just return a NXDOMAIN
|
||||
// make this a separate so we can insert some logic later.
|
||||
m.Ns = soa(state.Zone)
|
||||
m.Rcode = dns.RcodeNameError
|
||||
w.WriteMsg(m)
|
||||
return 0, nil
|
||||
|
||||
}
|
||||
if strings.HasPrefix(strings.ToLower(labels[0]), "endpoint-") {
|
||||
// recheck if the cluster exist.
|
||||
cluster = labels[1]
|
||||
|
||||
Reference in New Issue
Block a user