mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -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)
|
labels := dns.SplitDomainName(cluster)
|
||||||
switch len(labels) {
|
switch len(labels) {
|
||||||
case 2:
|
case 2:
|
||||||
// endpoint or _tcp
|
// endpoint or _tcp or _grpc_config query
|
||||||
if strings.ToLower(labels[0]) == "_tcp" {
|
if strings.ToLower(labels[0]) == "_tcp" {
|
||||||
// nodata, because empty non-terminal
|
// nodata, because empty non-terminal
|
||||||
m.Ns = soa(state.Zone)
|
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)
|
w.WriteMsg(m)
|
||||||
return 0, nil
|
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-") {
|
if strings.HasPrefix(strings.ToLower(labels[0]), "endpoint-") {
|
||||||
// recheck if the cluster exist.
|
// recheck if the cluster exist.
|
||||||
cluster = labels[1]
|
cluster = labels[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user