Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
ece3cf8e
Commit
ece3cf8e
authored
Nov 13, 2016
by
Michael Grosser
Committed by
Miek Gieben
Nov 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various issues with formatting and typos (#424)
* Fix typos * Simplify code * Fix error usage
parent
f402b8f7
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
19 additions
and
19 deletions
+19
-19
middleware/backend.go
middleware/backend.go
+1
-1
middleware/cache/cache.go
middleware/cache/cache.go
+1
-1
middleware/cache/item.go
middleware/cache/item.go
+1
-1
middleware/dnssec/black_lies_test.go
middleware/dnssec/black_lies_test.go
+1
-1
middleware/file/setup.go
middleware/file/setup.go
+2
-2
middleware/file/tree/print.go
middleware/file/tree/print.go
+1
-1
middleware/kubernetes/kubernetes.go
middleware/kubernetes/kubernetes.go
+1
-1
middleware/kubernetes/nametemplate/nametemplate_test.go
middleware/kubernetes/nametemplate/nametemplate_test.go
+3
-3
middleware/metrics/vars/vars.go
middleware/metrics/vars/vars.go
+1
-1
middleware/pkg/edns/edns.go
middleware/pkg/edns/edns.go
+1
-1
middleware/pkg/rcode/rcode.go
middleware/pkg/rcode/rcode.go
+1
-1
middleware/pkg/storage/fs.go
middleware/pkg/storage/fs.go
+1
-1
test/auto_test.go
test/auto_test.go
+4
-4
No files found.
middleware/backend.go
View file @
ece3cf8e
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
// ServiceBackend defines a (dynamic) backend that returns a slice of service definitions.
// ServiceBackend defines a (dynamic) backend that returns a slice of service definitions.
type
ServiceBackend
interface
{
type
ServiceBackend
interface
{
// Services communicates with the backend to retrieve the service defintion. Exact indicates
// Services communicates with the backend to retrieve the service defin
i
tion. Exact indicates
// on exact much are that we are allowed to recurs.
// on exact much are that we are allowed to recurs.
Services
(
state
request
.
Request
,
exact
bool
,
opt
Options
)
([]
msg
.
Service
,
[]
msg
.
Service
,
error
)
Services
(
state
request
.
Request
,
exact
bool
,
opt
Options
)
([]
msg
.
Service
,
[]
msg
.
Service
,
error
)
...
...
middleware/cache/cache.go
View file @
ece3cf8e
...
@@ -130,7 +130,7 @@ const (
...
@@ -130,7 +130,7 @@ const (
defaultCap
=
10000
// default capacity of the cache.
defaultCap
=
10000
// default capacity of the cache.
// Success is the class for caching postive caching.
// Success is the class for caching pos
i
tive caching.
Success
=
"success"
Success
=
"success"
// Denial is the class defined for negative caching.
// Denial is the class defined for negative caching.
Denial
=
"denial"
Denial
=
"denial"
...
...
middleware/cache/item.go
View file @
ece3cf8e
...
@@ -47,7 +47,7 @@ func newItem(m *dns.Msg, d time.Duration) *item {
...
@@ -47,7 +47,7 @@ func newItem(m *dns.Msg, d time.Duration) *item {
}
}
// toMsg turns i into a message, it tailers the reply to m.
// toMsg turns i into a message, it tailers the reply to m.
// The Autoritative bit is always set to 0, because the answer is from the cache.
// The Aut
h
oritative bit is always set to 0, because the answer is from the cache.
func
(
i
*
item
)
toMsg
(
m
*
dns
.
Msg
)
*
dns
.
Msg
{
func
(
i
*
item
)
toMsg
(
m
*
dns
.
Msg
)
*
dns
.
Msg
{
m1
:=
new
(
dns
.
Msg
)
m1
:=
new
(
dns
.
Msg
)
m1
.
SetReply
(
m
)
m1
.
SetReply
(
m
)
...
...
middleware/dnssec/black_lies_test.go
View file @
ece3cf8e
...
@@ -43,7 +43,7 @@ func TestZoneSigningBlackLies(t *testing.T) {
...
@@ -43,7 +43,7 @@ func TestZoneSigningBlackLies(t *testing.T) {
func
testNxdomainMsg
()
*
dns
.
Msg
{
func
testNxdomainMsg
()
*
dns
.
Msg
{
return
&
dns
.
Msg
{
MsgHdr
:
dns
.
MsgHdr
{
Rcode
:
dns
.
RcodeNameError
},
return
&
dns
.
Msg
{
MsgHdr
:
dns
.
MsgHdr
{
Rcode
:
dns
.
RcodeNameError
},
Question
:
[]
dns
.
Question
{
dns
.
Question
{
Name
:
"ww.miek.nl."
,
Qclass
:
dns
.
ClassINET
,
Qtype
:
dns
.
TypeTXT
}},
Question
:
[]
dns
.
Question
{{
Name
:
"ww.miek.nl."
,
Qclass
:
dns
.
ClassINET
,
Qtype
:
dns
.
TypeTXT
}},
Ns
:
[]
dns
.
RR
{
test
.
SOA
(
"miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1461471181 14400 3600 604800 14400"
)},
Ns
:
[]
dns
.
RR
{
test
.
SOA
(
"miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1461471181 14400 3600 604800 14400"
)},
}
}
}
}
middleware/file/setup.go
View file @
ece3cf8e
...
@@ -126,7 +126,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er
...
@@ -126,7 +126,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er
for
i
:=
range
tos
{
for
i
:=
range
tos
{
if
tos
[
i
]
!=
"*"
{
if
tos
[
i
]
!=
"*"
{
if
x
:=
net
.
ParseIP
(
tos
[
i
]);
x
==
nil
{
if
x
:=
net
.
ParseIP
(
tos
[
i
]);
x
==
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"must specify an IP addres: `%s'"
,
tos
[
i
])
return
nil
,
nil
,
fmt
.
Errorf
(
"must specify an IP addres
s
: `%s'"
,
tos
[
i
])
}
}
tos
[
i
]
=
middleware
.
Addr
(
tos
[
i
])
.
Normalize
()
tos
[
i
]
=
middleware
.
Addr
(
tos
[
i
])
.
Normalize
()
}
}
...
@@ -140,7 +140,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er
...
@@ -140,7 +140,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er
for
i
:=
range
froms
{
for
i
:=
range
froms
{
if
froms
[
i
]
!=
"*"
{
if
froms
[
i
]
!=
"*"
{
if
x
:=
net
.
ParseIP
(
froms
[
i
]);
x
==
nil
{
if
x
:=
net
.
ParseIP
(
froms
[
i
]);
x
==
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"must specify an IP addres: `%s'"
,
froms
[
i
])
return
nil
,
nil
,
fmt
.
Errorf
(
"must specify an IP addres
s
: `%s'"
,
froms
[
i
])
}
}
froms
[
i
]
=
middleware
.
Addr
(
froms
[
i
])
.
Normalize
()
froms
[
i
]
=
middleware
.
Addr
(
froms
[
i
])
.
Normalize
()
}
else
{
}
else
{
...
...
middleware/file/tree/print.go
View file @
ece3cf8e
...
@@ -56,7 +56,7 @@ func (q *queue) pop() *Node {
...
@@ -56,7 +56,7 @@ func (q *queue) pop() *Node {
return
n
return
n
}
}
// empty returns true when the queue contain
e
s zero nodes.
// empty returns true when the queue contains zero nodes.
func
(
q
*
queue
)
empty
()
bool
{
func
(
q
*
queue
)
empty
()
bool
{
return
len
(
*
q
)
==
0
return
len
(
*
q
)
==
0
}
}
middleware/kubernetes/kubernetes.go
View file @
ece3cf8e
...
@@ -286,7 +286,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
...
@@ -286,7 +286,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
}
}
for
_
,
service
:=
range
svcList
{
for
_
,
service
:=
range
svcList
{
if
service
.
Spec
.
ClusterIP
==
ip
{
if
service
.
Spec
.
ClusterIP
==
ip
{
return
[]
msg
.
Service
{
msg
.
Service
{
Host
:
ip
}}
return
[]
msg
.
Service
{{
Host
:
ip
}}
}
}
}
}
...
...
middleware/kubernetes/nametemplate/nametemplate_test.go
View file @
ece3cf8e
...
@@ -14,9 +14,9 @@ const (
...
@@ -14,9 +14,9 @@ const (
// Map of format string :: expected locations of name symbols in the format.
// Map of format string :: expected locations of name symbols in the format.
// -1 value indicates that symbol does not exist in format.
// -1 value indicates that symbol does not exist in format.
var
exampleTemplates
=
map
[
string
][]
int
{
var
exampleTemplates
=
map
[
string
][]
int
{
"{service}.{namespace}.{type}.{zone}"
:
[]
int
{
3
,
1
,
0
},
// service symbol expected @ position 0, namespace @ 1, zone @ 3
"{service}.{namespace}.{type}.{zone}"
:
{
3
,
1
,
0
},
// service symbol expected @ position 0, namespace @ 1, zone @ 3
"{namespace}.{type}.{zone}"
:
[]
int
{
2
,
0
,
-
1
},
"{namespace}.{type}.{zone}"
:
{
2
,
0
,
-
1
},
""
:
[]
int
{
-
1
,
-
1
,
-
1
},
""
:
{
-
1
,
-
1
,
-
1
},
}
}
func
TestSetTemplate
(
t
*
testing
.
T
)
{
func
TestSetTemplate
(
t
*
testing
.
T
)
{
...
...
middleware/metrics/vars/vars.go
View file @
ece3cf8e
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus"
)
)
// Request* and Reponse* are the prometheus counters and gauges we are using for exporting metrics.
// Request* and Re
s
ponse* are the prometheus counters and gauges we are using for exporting metrics.
var
(
var
(
RequestCount
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
RequestCount
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Namespace
:
middleware
.
Namespace
,
Namespace
:
middleware
.
Namespace
,
...
...
middleware/pkg/edns/edns.go
View file @
ece3cf8e
// Package edns provides function useful
l
for adding/inspecting OPT records to/in messages.
// Package edns provides function useful for adding/inspecting OPT records to/in messages.
package
edns
package
edns
import
(
import
(
...
...
middleware/pkg/rcode/rcode.go
View file @
ece3cf8e
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
"github.com/miekg/dns"
"github.com/miekg/dns"
)
)
// ToString convert the rcode to the offical DNS string, or to "RCODE"+value if the RCODE
// ToString convert the rcode to the offic
i
al DNS string, or to "RCODE"+value if the RCODE
// value is unknown.
// value is unknown.
func
ToString
(
rcode
int
)
string
{
func
ToString
(
rcode
int
)
string
{
if
str
,
ok
:=
dns
.
RcodeToString
[
rcode
];
ok
{
if
str
,
ok
:=
dns
.
RcodeToString
[
rcode
];
ok
{
...
...
middleware/pkg/storage/fs.go
View file @
ece3cf8e
...
@@ -24,7 +24,7 @@ type dir http.Dir
...
@@ -24,7 +24,7 @@ type dir http.Dir
// Dexample.org/...
// Dexample.org/...
// Db.example.org/...
// Db.example.org/...
//
//
// CoreDir will default to "$HOME/.coredns" on Unix, but it's location can be overriden with the COREDNSPATH
// CoreDir will default to "$HOME/.coredns" on Unix, but it's location can be overrid
d
en with the COREDNSPATH
// environment variable.
// environment variable.
var
CoreDir
=
dir
(
fsPath
())
var
CoreDir
=
dir
(
fsPath
())
...
...
test/auto_test.go
View file @
ece3cf8e
...
@@ -35,7 +35,7 @@ func TestAuto(t *testing.T) {
...
@@ -35,7 +35,7 @@ func TestAuto(t *testing.T) {
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
if
udp
==
""
{
if
udp
==
""
{
t
.
Fatal
f
(
"Could not get UDP listening port"
)
t
.
Fatal
(
"Could not get UDP listening port"
)
}
}
defer
i
.
Stop
()
defer
i
.
Stop
()
...
@@ -102,7 +102,7 @@ func TestAutoNonExistentZone(t *testing.T) {
...
@@ -102,7 +102,7 @@ func TestAutoNonExistentZone(t *testing.T) {
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
if
udp
==
""
{
if
udp
==
""
{
t
.
Fatal
f
(
"Could not get UDP listening port"
)
t
.
Fatal
(
"Could not get UDP listening port"
)
}
}
defer
i
.
Stop
()
defer
i
.
Stop
()
...
@@ -141,7 +141,7 @@ func TestAutoAXFR(t *testing.T) {
...
@@ -141,7 +141,7 @@ func TestAutoAXFR(t *testing.T) {
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
udp
,
_
:=
CoreDNSServerPorts
(
i
,
0
)
if
udp
==
""
{
if
udp
==
""
{
t
.
Fatal
f
(
"Could not get UDP listening port"
)
t
.
Fatal
(
"Could not get UDP listening port"
)
}
}
defer
i
.
Stop
()
defer
i
.
Stop
()
...
@@ -162,7 +162,7 @@ func TestAutoAXFR(t *testing.T) {
...
@@ -162,7 +162,7 @@ func TestAutoAXFR(t *testing.T) {
t
.
Fatal
(
"Expected to receive reply, but didn't"
)
t
.
Fatal
(
"Expected to receive reply, but didn't"
)
}
}
if
len
(
resp
.
Answer
)
!=
5
{
if
len
(
resp
.
Answer
)
!=
5
{
t
.
Fatal
(
"Expected response with %d RRs, got %d"
,
5
,
len
(
resp
.
Answer
))
t
.
Fatal
f
(
"Expected response with %d RRs, got %d"
,
5
,
len
(
resp
.
Answer
))
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment