mirror of
https://github.com/coredns/coredns.git
synced 2025-11-09 21:42:17 -05:00
Fix various issues with formatting and typos (#424)
* Fix typos * Simplify code * Fix error usage
This commit is contained in:
committed by
Miek Gieben
parent
f402b8f726
commit
ece3cf8ecf
@@ -286,7 +286,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
|
||||
}
|
||||
for _, service := range svcList {
|
||||
if service.Spec.ClusterIP == ip {
|
||||
return []msg.Service{msg.Service{Host: ip}}
|
||||
return []msg.Service{{Host: ip}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ const (
|
||||
// Map of format string :: expected locations of name symbols in the format.
|
||||
// -1 value indicates that symbol does not exist in format.
|
||||
var exampleTemplates = map[string][]int{
|
||||
"{service}.{namespace}.{type}.{zone}": []int{3, 1, 0}, // service symbol expected @ position 0, namespace @ 1, zone @ 3
|
||||
"{namespace}.{type}.{zone}": []int{2, 0, -1},
|
||||
"": []int{-1, -1, -1},
|
||||
"{service}.{namespace}.{type}.{zone}": {3, 1, 0}, // service symbol expected @ position 0, namespace @ 1, zone @ 3
|
||||
"{namespace}.{type}.{zone}": {2, 0, -1},
|
||||
"": {-1, -1, -1},
|
||||
}
|
||||
|
||||
func TestSetTemplate(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user