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
e233f59e
Commit
e233f59e
authored
Sep 01, 2020
by
Hu Shuai
Committed by
GitHub
Sep 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some typos in comments. (#4100)
Signed-off-by:
Hu Shuai
<
hus.fnst@cn.fujitsu.com
>
parent
9e4a177d
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
42 additions
and
42 deletions
+42
-42
core/dnsserver/config.go
core/dnsserver/config.go
+1
-1
core/dnsserver/onstartup.go
core/dnsserver/onstartup.go
+1
-1
core/dnsserver/server.go
core/dnsserver/server.go
+1
-1
core/dnsserver/server_grpc.go
core/dnsserver/server_grpc.go
+1
-1
core/dnsserver/server_https.go
core/dnsserver/server_https.go
+1
-1
core/dnsserver/server_tls.go
core/dnsserver/server_tls.go
+1
-1
plugin/autopath/autopath.go
plugin/autopath/autopath.go
+1
-1
plugin/backend.go
plugin/backend.go
+1
-1
plugin/dnssec/cache.go
plugin/dnssec/cache.go
+1
-1
plugin/dnssec/responsewriter.go
plugin/dnssec/responsewriter.go
+1
-1
plugin/dnssec/rrsig.go
plugin/dnssec/rrsig.go
+1
-1
plugin/dnstap/taprw/writer.go
plugin/dnstap/taprw/writer.go
+1
-1
plugin/file/secondary.go
plugin/file/secondary.go
+1
-1
plugin/forward/persistent.go
plugin/forward/persistent.go
+1
-1
plugin/kubernetes/autopath.go
plugin/kubernetes/autopath.go
+1
-1
plugin/kubernetes/object/endpoint.go
plugin/kubernetes/object/endpoint.go
+1
-1
plugin/kubernetes/object/service.go
plugin/kubernetes/object/service.go
+1
-1
plugin/kubernetes/parse.go
plugin/kubernetes/parse.go
+1
-1
plugin/rewrite/edns0.go
plugin/rewrite/edns0.go
+3
-3
plugin/rewrite/name.go
plugin/rewrite/name.go
+8
-8
plugin/rewrite/ttl.go
plugin/rewrite/ttl.go
+5
-5
plugin/test/helpers.go
plugin/test/helpers.go
+1
-1
plugin/test/responsewriter.go
plugin/test/responsewriter.go
+6
-6
plugin/test/scrape.go
plugin/test/scrape.go
+1
-1
No files found.
core/dnsserver/config.go
View file @
e233f59e
...
...
@@ -52,7 +52,7 @@ type Config struct {
registry
map
[
string
]
plugin
.
Handler
}
// keyForConfig build a key for identifying the configs during setup time
// keyForConfig build
s
a key for identifying the configs during setup time
func
keyForConfig
(
blocIndex
int
,
blocKeyIndex
int
)
string
{
return
fmt
.
Sprintf
(
"%d:%d"
,
blocIndex
,
blocKeyIndex
)
}
...
...
core/dnsserver/onstartup.go
View file @
e233f59e
...
...
@@ -2,7 +2,7 @@ package dnsserver
import
"fmt"
// startUpZones create the text that we show when starting up:
// startUpZones create
s
the text that we show when starting up:
// grpc://example.com.:1055
// example.com.:1053 on 127.0.0.1
func
startUpZones
(
protocol
,
addr
string
,
zones
map
[
string
]
*
Config
)
string
{
...
...
core/dnsserver/server.go
View file @
e233f59e
...
...
@@ -194,7 +194,7 @@ func (s *Server) Stop() (err error) {
// Address together with Stop() implement caddy.GracefulServer.
func
(
s
*
Server
)
Address
()
string
{
return
s
.
Addr
}
// ServeDNS is the entry point for every request to the address that
s
// ServeDNS is the entry point for every request to the address that
// is bound to. It acts as a multiplexer for the requests zonename as
// defined in the request so that the correct zone
// (configuration and plugin stack) will handle the request.
...
...
core/dnsserver/server_grpc.go
View file @
e233f59e
...
...
@@ -34,7 +34,7 @@ func NewServergRPC(addr string, group []*Config) (*ServergRPC, error) {
return
nil
,
err
}
// The *tls* plugin must make sure that multiple conflicting
// TLS configuration return an error: it can only be specified once.
// TLS configuration return
s
an error: it can only be specified once.
var
tlsConfig
*
tls
.
Config
for
_
,
conf
:=
range
s
.
zones
{
// Should we error if some configs *don't* have TLS?
...
...
core/dnsserver/server_https.go
View file @
e233f59e
...
...
@@ -33,7 +33,7 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) {
return
nil
,
err
}
// The *tls* plugin must make sure that multiple conflicting
// TLS configuration return an error: it can only be specified once.
// TLS configuration return
s
an error: it can only be specified once.
var
tlsConfig
*
tls
.
Config
for
_
,
conf
:=
range
s
.
zones
{
// Should we error if some configs *don't* have TLS?
...
...
core/dnsserver/server_tls.go
View file @
e233f59e
...
...
@@ -26,7 +26,7 @@ func NewServerTLS(addr string, group []*Config) (*ServerTLS, error) {
return
nil
,
err
}
// The *tls* plugin must make sure that multiple conflicting
// TLS configuration return an error: it can only be specified once.
// TLS configuration return
s
an error: it can only be specified once.
var
tlsConfig
*
tls
.
Config
for
_
,
conf
:=
range
s
.
zones
{
// Should we error if some configs *don't* have TLS?
...
...
plugin/autopath/autopath.go
View file @
e233f59e
...
...
@@ -54,7 +54,7 @@ type AutoPather interface {
AutoPath
(
request
.
Request
)
[]
string
}
// AutoPath perform autopath: service side search path completion.
// AutoPath perform
s
autopath: service side search path completion.
type
AutoPath
struct
{
Next
plugin
.
Handler
Zones
[]
string
...
...
plugin/backend.go
View file @
e233f59e
...
...
@@ -26,7 +26,7 @@ type ServiceBackend interface {
// Note: it does not implement a specific service.
Records
(
ctx
context
.
Context
,
state
request
.
Request
,
exact
bool
)
([]
msg
.
Service
,
error
)
// IsNameError return true if err indicated a record not found condition
// IsNameError return
s
true if err indicated a record not found condition
IsNameError
(
err
error
)
bool
Transferer
...
...
plugin/dnssec/cache.go
View file @
e233f59e
...
...
@@ -6,7 +6,7 @@ import (
"github.com/miekg/dns"
)
// hash serializes the RRset and return a signature cache key.
// hash serializes the RRset and return
s
a signature cache key.
func
hash
(
rrs
[]
dns
.
RR
)
uint64
{
h
:=
fnv
.
New64
()
buf
:=
make
([]
byte
,
256
)
...
...
plugin/dnssec/responsewriter.go
View file @
e233f59e
...
...
@@ -9,7 +9,7 @@ import (
"github.com/miekg/dns"
)
// ResponseWriter sign the response on the fly.
// ResponseWriter sign
s
the response on the fly.
type
ResponseWriter
struct
{
dns
.
ResponseWriter
d
Dnssec
...
...
plugin/dnssec/rrsig.go
View file @
e233f59e
...
...
@@ -2,7 +2,7 @@ package dnssec
import
"github.com/miekg/dns"
// newRRSIG return a new RRSIG, with all fields filled out, except the signed data.
// newRRSIG return
s
a new RRSIG, with all fields filled out, except the signed data.
func
(
k
*
DNSKEY
)
newRRSIG
(
signerName
string
,
ttl
,
incep
,
expir
uint32
)
*
dns
.
RRSIG
{
sig
:=
new
(
dns
.
RRSIG
)
...
...
plugin/dnstap/taprw/writer.go
View file @
e233f59e
...
...
@@ -38,7 +38,7 @@ type ResponseWriter struct {
dnstapErr
error
}
// DnstapError check if a dnstap error occurred during Write and returns it.
// DnstapError check
s
if a dnstap error occurred during Write and returns it.
func
(
w
*
ResponseWriter
)
DnstapError
()
error
{
return
w
.
dnstapErr
}
...
...
plugin/file/secondary.go
View file @
e233f59e
...
...
@@ -95,7 +95,7 @@ Transfer:
return
less
(
z
.
Apex
.
SOA
.
Serial
,
uint32
(
serial
)),
Err
}
// less return true of a is smaller than b when taking RFC 1982 serial arithmetic into account.
// less return
s
true of a is smaller than b when taking RFC 1982 serial arithmetic into account.
func
less
(
a
,
b
uint32
)
bool
{
if
a
<
b
{
return
(
b
-
a
)
<=
MaxSerialIncrement
...
...
plugin/forward/persistent.go
View file @
e233f59e
...
...
@@ -121,7 +121,7 @@ func (t *Transport) cleanup(all bool) {
// It is hard to pin a value to this, the import thing is to no block forever, losing at cached connection is not terrible.
const
yieldTimeout
=
25
*
time
.
Millisecond
// Yield return the connection to transport for reuse.
// Yield return
s
the connection to transport for reuse.
func
(
t
*
Transport
)
Yield
(
pc
*
persistConn
)
{
pc
.
used
=
time
.
Now
()
// update used time
...
...
plugin/kubernetes/autopath.go
View file @
e233f59e
...
...
@@ -49,7 +49,7 @@ func (k *Kubernetes) AutoPath(state request.Request) []string {
return
search
}
// podWithIP return the api.Pod for source IP. It returns nil if nothing can be found.
// podWithIP return
s
the api.Pod for source IP. It returns nil if nothing can be found.
func
(
k
*
Kubernetes
)
podWithIP
(
ip
string
)
*
object
.
Pod
{
if
k
.
podMode
!=
podModeVerified
{
return
nil
...
...
plugin/kubernetes/object/endpoint.go
View file @
e233f59e
...
...
@@ -42,7 +42,7 @@ type EndpointPort struct {
Protocol
string
}
// EndpointsKey return a string using for the index.
// EndpointsKey return
s
a string using for the index.
func
EndpointsKey
(
name
,
namespace
string
)
string
{
return
name
+
"."
+
namespace
}
// ToEndpoints returns a function that converts an *api.Endpoints to a *Endpoints.
...
...
plugin/kubernetes/object/service.go
View file @
e233f59e
...
...
@@ -25,7 +25,7 @@ type Service struct {
*
Empty
}
// ServiceKey return a string using for the index.
// ServiceKey return
s
a string using for the index.
func
ServiceKey
(
name
,
namespace
string
)
string
{
return
name
+
"."
+
namespace
}
// ToService returns a function that converts an api.Service to a *Service.
...
...
plugin/kubernetes/parse.go
View file @
e233f59e
...
...
@@ -99,7 +99,7 @@ func stripUnderscore(s string) string {
return
s
[
1
:
]
}
// String return a string representation of r, it just returns all fields concatenated with dots.
// String return
s
a string representation of r, it just returns all fields concatenated with dots.
// This is mostly used in tests.
func
(
r
recordRequest
)
String
()
string
{
s
:=
r
.
port
...
...
plugin/rewrite/edns0.go
View file @
e233f59e
...
...
@@ -73,7 +73,7 @@ func (rule *edns0NsidRule) Rewrite(ctx context.Context, state request.Request) R
// Mode returns the processing mode.
func
(
rule
*
edns0NsidRule
)
Mode
()
string
{
return
rule
.
mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
edns0NsidRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
// Rewrite will alter the request EDNS0 local options.
...
...
@@ -103,7 +103,7 @@ func (rule *edns0LocalRule) Rewrite(ctx context.Context, state request.Request)
// Mode returns the processing mode.
func
(
rule
*
edns0LocalRule
)
Mode
()
string
{
return
rule
.
mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
edns0LocalRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
// newEdns0Rule creates an EDNS0 rule of the appropriate type based on the args
...
...
@@ -253,7 +253,7 @@ func (rule *edns0VariableRule) Rewrite(ctx context.Context, state request.Reques
// Mode returns the processing mode.
func
(
rule
*
edns0VariableRule
)
Mode
()
string
{
return
rule
.
mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
edns0VariableRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
func
isValidVariable
(
variable
string
)
bool
{
...
...
plugin/rewrite/name.go
View file @
e233f59e
...
...
@@ -245,27 +245,27 @@ func (rule *suffixNameRule) Mode() string { return rule.NextAction }
func
(
rule
*
substringNameRule
)
Mode
()
string
{
return
rule
.
NextAction
}
func
(
rule
*
regexNameRule
)
Mode
()
string
{
return
rule
.
NextAction
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
exactNameRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
prefixNameRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
suffixNameRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
substringNameRule
)
GetResponseRule
()
ResponseRule
{
return
ResponseRule
{}
}
// GetResponseRule return a rule to rewrite the response with.
// GetResponseRule return
s
a rule to rewrite the response with.
func
(
rule
*
regexNameRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// hasClosingDot return true if s has a closing dot at the end.
// hasClosingDot return
s
true if s has a closing dot at the end.
func
hasClosingDot
(
s
string
)
bool
{
return
strings
.
HasSuffix
(
s
,
"."
)
}
// getSubExprUsage return the number of subexpressions used in s.
// getSubExprUsage return
s
the number of subexpressions used in s.
func
getSubExprUsage
(
s
string
)
int
{
subExprUsage
:=
0
for
i
:=
0
;
i
<=
100
;
i
++
{
...
...
@@ -276,7 +276,7 @@ func getSubExprUsage(s string) int {
return
subExprUsage
}
// isValidRegexPattern return a regular expression for pattern matching or errors, if any.
// isValidRegexPattern return
s
a regular expression for pattern matching or errors, if any.
func
isValidRegexPattern
(
rewriteFrom
,
rewriteTo
string
)
(
*
regexp
.
Regexp
,
error
)
{
rewriteFromPattern
,
err
:=
regexp
.
Compile
(
rewriteFrom
)
if
err
!=
nil
{
...
...
plugin/rewrite/ttl.go
View file @
e233f59e
...
...
@@ -183,27 +183,27 @@ func (rule *suffixTTLRule) Mode() string { return rule.NextAction }
func
(
rule
*
substringTTLRule
)
Mode
()
string
{
return
rule
.
NextAction
}
func
(
rule
*
regexTTLRule
)
Mode
()
string
{
return
rule
.
NextAction
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
exactTTLRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
prefixTTLRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
suffixTTLRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
// GetResponseRule return
s
a rule to rewrite the response with. Currently not implemented.
func
(
rule
*
substringTTLRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
// GetResponseRule return a rule to rewrite the response with.
// GetResponseRule return
s
a rule to rewrite the response with.
func
(
rule
*
regexTTLRule
)
GetResponseRule
()
ResponseRule
{
return
rule
.
ResponseRule
}
...
...
plugin/test/helpers.go
View file @
e233f59e
...
...
@@ -112,7 +112,7 @@ func OPT(bufsize int, do bool) *dns.OPT {
return
o
}
// Header test if the header in resp matches the header as defined in tc.
// Header test
s
if the header in resp matches the header as defined in tc.
func
Header
(
tc
Case
,
resp
*
dns
.
Msg
)
error
{
if
resp
.
Rcode
!=
tc
.
Rcode
{
return
fmt
.
Errorf
(
"rcode is %q, expected %q"
,
dns
.
RcodeToString
[
resp
.
Rcode
],
dns
.
RcodeToString
[
tc
.
Rcode
])
...
...
plugin/test/responsewriter.go
View file @
e233f59e
...
...
@@ -38,22 +38,22 @@ func (t *ResponseWriter) RemoteAddr() net.Addr {
return
&
net
.
UDPAddr
{
IP
:
ip
,
Port
:
port
,
Zone
:
""
}
}
// WriteMsg implement dns.ResponseWriter interface.
// WriteMsg implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
WriteMsg
(
m
*
dns
.
Msg
)
error
{
return
nil
}
// Write implement dns.ResponseWriter interface.
// Write implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
Write
(
buf
[]
byte
)
(
int
,
error
)
{
return
len
(
buf
),
nil
}
// Close implement dns.ResponseWriter interface.
// Close implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
Close
()
error
{
return
nil
}
// TsigStatus implement dns.ResponseWriter interface.
// TsigStatus implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
TsigStatus
()
error
{
return
nil
}
// TsigTimersOnly implement dns.ResponseWriter interface.
// TsigTimersOnly implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
TsigTimersOnly
(
bool
)
{}
// Hijack implement dns.ResponseWriter interface.
// Hijack implement
s
dns.ResponseWriter interface.
func
(
t
*
ResponseWriter
)
Hijack
()
{}
// ResponseWriter6 returns fixed client and remote address in IPv6. The remote
...
...
plugin/test/scrape.go
View file @
e233f59e
...
...
@@ -77,7 +77,7 @@ func Scrape(url string) []*MetricFamily {
return
result
}
// ScrapeMetricAsInt provide a sum of all metrics collected for the name and label provided.
// ScrapeMetricAsInt provide
s
a sum of all metrics collected for the name and label provided.
// if the metric is not a numeric value, it will be counted a 0.
func
ScrapeMetricAsInt
(
addr
string
,
name
string
,
label
string
,
nometricvalue
int
)
int
{
...
...
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