mw/k8s: remove k.defaultNsMsg() (#892)
Remove k.defaultNSMsg() it is just one line of getting the service and it is another method that needlessly uses recordRequest.
This commit is contained in:
parent
c0f62e3f65
commit
b5d2a82ed7
2 changed files with 3 additions and 16 deletions
|
@ -4,24 +4,10 @@ import (
|
|||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/coredns/coredns/middleware/etcd/msg"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"k8s.io/client-go/1.5/pkg/api"
|
||||
)
|
||||
|
||||
// DefaultNSMsg returns an msg.Service representing an A record for
|
||||
// ns.dns.[zone] -> dns service ip. This A record is needed to legitimize
|
||||
// the SOA response in middleware.NS(), which is hardcoded at ns.dns.[zone].
|
||||
func (k *Kubernetes) defaultNSMsg(r recordRequest) msg.Service {
|
||||
ns := k.nsAddr()
|
||||
s := msg.Service{
|
||||
Key: msg.Path(strings.Join([]string{defaultNSName, r.zone}, "."), "coredns"),
|
||||
Host: ns.A.String(),
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func isDefaultNS(name string, r recordRequest) bool {
|
||||
return strings.Index(name, defaultNSName) == 0 && strings.Index(name, r.zone) == len(defaultNSName)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue