mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 01:04:15 -04:00
cleanup: go vet and golint run (#736)
* cleanup: go vet and golint run Various cleanups trickered by go vet and golint. * Fix tests and lowercase all errors Lowercase all errors, some tests in kubernetes use errors from kubernetes which do start with a capital letter.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/coredns/coredns/middleware/etcd/msg"
|
||||
)
|
||||
|
||||
// Federation holds TODO(...).
|
||||
type Federation struct {
|
||||
name string
|
||||
zone string
|
||||
@@ -26,8 +27,8 @@ const (
|
||||
//
|
||||
// But importing above breaks coredns with flag collision of 'log_dir'
|
||||
|
||||
LabelAvailabilityZone = "failure-domain.beta.kubernetes.io/zone"
|
||||
LabelRegion = "failure-domain.beta.kubernetes.io/region"
|
||||
labelAvailabilityZone = "failure-domain.beta.kubernetes.io/zone"
|
||||
labelRegion = "failure-domain.beta.kubernetes.io/region"
|
||||
)
|
||||
|
||||
// stripFederation removes the federation segment from the segment list, if it
|
||||
@@ -66,12 +67,12 @@ func (k *Kubernetes) federationCNAMERecord(r recordRequest) msg.Service {
|
||||
if r.endpoint == "" {
|
||||
return msg.Service{
|
||||
Key: strings.Join([]string{msg.Path(r.zone, "coredns"), r.typeName, r.federation, r.namespace, r.service}, "/"),
|
||||
Host: strings.Join([]string{r.service, r.namespace, r.federation, r.typeName, node.Labels[LabelAvailabilityZone], node.Labels[LabelRegion], f.zone}, "."),
|
||||
Host: strings.Join([]string{r.service, r.namespace, r.federation, r.typeName, node.Labels[labelAvailabilityZone], node.Labels[labelRegion], f.zone}, "."),
|
||||
}
|
||||
}
|
||||
return msg.Service{
|
||||
Key: strings.Join([]string{msg.Path(r.zone, "coredns"), r.typeName, r.federation, r.namespace, r.service, r.endpoint}, "/"),
|
||||
Host: strings.Join([]string{r.endpoint, r.service, r.namespace, r.federation, r.typeName, node.Labels[LabelAvailabilityZone], node.Labels[LabelRegion], f.zone}, "."),
|
||||
Host: strings.Join([]string{r.endpoint, r.service, r.namespace, r.federation, r.typeName, node.Labels[labelAvailabilityZone], node.Labels[labelRegion], f.zone}, "."),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user