unexpose items per lint (#701)
This commit is contained in:
parent
bdf71cf251
commit
ecae087201
2 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
"k8s.io/client-go/1.5/pkg/api"
|
||||
)
|
||||
|
||||
const DefaultNSName = "ns.dns."
|
||||
const defaultNSName = "ns.dns."
|
||||
|
||||
var corednsRecord dns.A
|
||||
|
||||
|
@ -25,7 +25,7 @@ func (i interfaceAddrs) interfaceAddrs() ([]net.Addr, error) {
|
|||
}
|
||||
|
||||
func (k *Kubernetes) recordsForNS(r recordRequest, svcs *[]msg.Service) error {
|
||||
ns := k.CoreDNSRecord()
|
||||
ns := k.coreDNSRecord()
|
||||
s := msg.Service{
|
||||
Host: ns.A.String(),
|
||||
Key: msg.Path(strings.Join([]string{ns.Hdr.Name, r.zone}, "."), "coredns")}
|
||||
|
@ -37,19 +37,19 @@ func (k *Kubernetes) recordsForNS(r recordRequest, svcs *[]msg.Service) error {
|
|||
// 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.CoreDNSRecord()
|
||||
ns := k.coreDNSRecord()
|
||||
s := msg.Service{
|
||||
Key: msg.Path(strings.Join([]string{DefaultNSName, r.zone}, "."), "coredns"),
|
||||
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)
|
||||
return strings.Index(name, defaultNSName) == 0 && strings.Index(name, r.zone) == len(defaultNSName)
|
||||
}
|
||||
|
||||
func (k *Kubernetes) CoreDNSRecord() dns.A {
|
||||
func (k *Kubernetes) coreDNSRecord() dns.A {
|
||||
var localIP net.IP
|
||||
var svcName string
|
||||
var svcNamespace string
|
||||
|
@ -87,7 +87,7 @@ func (k *Kubernetes) CoreDNSRecord() dns.A {
|
|||
}
|
||||
|
||||
if len(svcName) == 0 {
|
||||
corednsRecord.Hdr.Name = DefaultNSName
|
||||
corednsRecord.Hdr.Name = defaultNSName
|
||||
corednsRecord.A = localIP
|
||||
return corednsRecord
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue