Skip to content

Commit

Permalink
Revert "add wildcard warnings (coredns#5030)" (coredns#5167)
Browse files Browse the repository at this point in the history
This reverts commit 744468e.
  • Loading branch information
chrisohaver authored Feb 9, 2022
1 parent 4349b6f commit 4693f40
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
11 changes: 0 additions & 11 deletions plugin/kubernetes/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package kubernetes

import (
"context"
"strings"
"sync/atomic"

"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/request"
Expand All @@ -29,10 +27,6 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
err error
)

if wildQuestion(state.Name()) {
atomic.AddUint64(&wildCount, 1)
}

switch state.QType() {
case dns.TypeA:
records, err = plugin.A(ctx, &k, zone, state, nil, plugin.Options{})
Expand Down Expand Up @@ -91,13 +85,8 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
m.Answer = append(m.Answer, records...)
m.Extra = append(m.Extra, extra...)
w.WriteMsg(m)

return dns.RcodeSuccess, nil
}

func wildQuestion(name string) bool {
return strings.HasPrefix(name, "*.") || strings.HasPrefix(name, "any.") || strings.Contains(name, ".*.") || strings.Contains(name, ".any.")
}

// Name implements the Handler interface.
func (k Kubernetes) Name() string { return "kubernetes" }
1 change: 0 additions & 1 deletion plugin/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ var (
errNoItems = errors.New("no items found")
errNsNotExposed = errors.New("namespace is not exposed")
errInvalidRequest = errors.New("invalid query name")
wildCount uint64
)

// Services implements the ServiceBackend interface.
Expand Down
21 changes: 0 additions & 21 deletions plugin/kubernetes/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"os"
"strconv"
"strings"
"sync/atomic"
"time"

"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
Expand Down Expand Up @@ -63,25 +61,6 @@ func setup(c *caddy.Controller) error {
return nil
})

wildWarner := time.NewTicker(10 * time.Second)
c.OnStartup(func() error {
go func() {
for {
select {
case <-wildWarner.C:
if wc := atomic.SwapUint64(&wildCount, 0); wc > 0 {
log.Warningf("%d deprecated wildcard queries received. Wildcard queries will no longer be supported in the next minor release.", wc)
}
}
}
}()
return nil
})
c.OnShutdown(func() error {
wildWarner.Stop()
return nil
})

return nil
}

Expand Down

0 comments on commit 4693f40

Please sign in to comment.