mirror of
https://github.com/coredns/coredns.git
synced 2025-11-03 02:33:21 -05:00
Remove debug queries (#1058)
* Remove debug from interface and methods * remove debug queries from etcd * remove debug queries from k8s - they were not used * And remove from mw/proxy-google as well * Remove debug query test
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/coredns/coredns/middleware/pkg/debug"
|
||||
"github.com/coredns/coredns/middleware/pkg/healthcheck"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
@@ -50,12 +49,6 @@ func (g *google) Exchange(ctx context.Context, addr string, state request.Reques
|
||||
v.Set("name", state.Name())
|
||||
v.Set("type", fmt.Sprintf("%d", state.QType()))
|
||||
|
||||
optDebug := false
|
||||
if bug := debug.IsDebug(state.Name()); bug != "" {
|
||||
optDebug = true
|
||||
v.Set("name", bug)
|
||||
}
|
||||
|
||||
buf, backendErr := g.exchangeJSON(addr, v.Encode())
|
||||
|
||||
if backendErr == nil {
|
||||
@@ -64,19 +57,11 @@ func (g *google) Exchange(ctx context.Context, addr string, state request.Reques
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m, debug, err := toMsg(gm)
|
||||
m, err := toMsg(gm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if optDebug {
|
||||
// reset question
|
||||
m.Question[0].Name = state.QName()
|
||||
// prepend debug RR to the additional section
|
||||
m.Extra = append([]dns.RR{debug}, m.Extra...)
|
||||
|
||||
}
|
||||
|
||||
m.Id = state.Req.Id
|
||||
return m, nil
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
// toMsg converts a googleMsg into the dns message. The returned RR is the comment disquised as a TXT record.
|
||||
func toMsg(g *googleMsg) (*dns.Msg, dns.RR, error) {
|
||||
// toMsg converts a googleMsg into the dns message.
|
||||
func toMsg(g *googleMsg) (*dns.Msg, error) {
|
||||
m := new(dns.Msg)
|
||||
m.Response = true
|
||||
m.Rcode = g.Status
|
||||
@@ -28,24 +28,23 @@ func toMsg(g *googleMsg) (*dns.Msg, dns.RR, error) {
|
||||
for i := 0; i < len(m.Answer); i++ {
|
||||
m.Answer[i], err = toRR(g.Answer[i])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
for i := 0; i < len(m.Ns); i++ {
|
||||
m.Ns[i], err = toRR(g.Authority[i])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
for i := 0; i < len(m.Extra); i++ {
|
||||
m.Extra[i], err = toRR(g.Additional[i])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
txt, _ := dns.NewRR(". 0 CH TXT " + g.Comment)
|
||||
return m, txt, nil
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// toRR transforms a "google" RR to a dns.RR.
|
||||
|
||||
Reference in New Issue
Block a user