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:
parent
5c10eba31c
commit
e49ca86ce4
21 changed files with 64 additions and 62 deletions
|
@ -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}, "."),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue