Skip to content

Commit

Permalink
Typo fixes (coredns#2031)
Browse files Browse the repository at this point in the history
  • Loading branch information
knweiss authored and yongtang committed Aug 14, 2018
1 parent 18a77cd commit 6d8a078
Show file tree
Hide file tree
Showing 34 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Currently CoreDNS is able to:
* Use k8s (kubernetes) as a backend (*kubernetes*).
* Serve as a proxy to forward queries to some other (recursive) nameserver (*proxy*, and *forward*).
* Provide metrics (by using Prometheus) (*metrics*).
* Provide query (*log*) and error (*error*) logging.
* Provide query (*log*) and error (*errors*) logging.
* Support the CH class: `version.bind` and friends (*chaos*).
* Support the RFC 5001 DNS name server identifier (NSID) option (*nsid*).
* Profiling support (*pprof*).
Expand Down
2 changes: 1 addition & 1 deletion corefile.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ properties than can have arguments, see the documentation for each plugin.
Comments are allowed and begin with an unquoted hash `#` and continue to the end of the line.
Comments may be started anywhere on a line.

Enviroment variables are supported and either the Unix or Windows form may be used: `{$ENV_VAR_1}`
Environment variables are supported and either the Unix or Windows form may be used: `{$ENV_VAR_1}`
or `{%ENV_VAR_2%}`.

You can use the `import` "plugin" to include parts of other files, see <https://coredns.io/explugins/import>.
Expand Down
2 changes: 1 addition & 1 deletion coremain/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Run() {
caddy.TrapSignals()

// Reset flag.CommandLine to get rid of unwanted flags for instance from glog (used in kubernetes).
// And readd the once we want to keep.
// And read the ones we want to keep.
flag.VisitAll(func(f *flag.Flag) {
if _, ok := flagsBlacklist[f.Name]; ok {
return
Expand Down
2 changes: 1 addition & 1 deletion plugin/auto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auto [ZONES...] {
**ZONES** zones it should be authoritative for. If empty, the zones from the configuration block
are used.

* `directory` loads zones from the speficied **DIR**. If a file name matches **REGEXP** it will be
* `directory` loads zones from the specified **DIR**. If a file name matches **REGEXP** it will be
used to extract the origin. **ORIGIN_TEMPLATE** will be used as a template for the origin. Strings
like `{<number>}` are replaced with the respective matches in the file name, e.g. `{1}` is the
first match, `{2}` is the second. The default is: `db\.(.*) {1}` i.e. from a file with the
Expand Down
2 changes: 1 addition & 1 deletion plugin/autopath/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func autoPathParse(c *caddy.Controller) (*AutoPath, string, error) {
}
ap.search = rc.Search
plugin.Zones(ap.search).Normalize()
ap.search = append(ap.search, "") // sentinal value as demanded.
ap.search = append(ap.search, "") // sentinel value as demanded.
}
ap.Zones = zoneAndresolv[:len(zoneAndresolv)-1]
if len(ap.Zones) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion plugin/etcd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ etcd [ZONES...] {
## Special Behaviour
CoreDNS etcd plugin leverages directory structure to look for related entries. For example an entry `/skydns/test/skydns/mx` would have entries like `/skydns/test/skydns/mx/a`, `/skydns/test/skydns/mx/b` and so on. Similarly a directory `/skydns/test/skydns/mx1` will have all `mx1` entries.

With etcd3, support for [hierarchial keys are dropped](https://coreos.com/etcd/docs/latest/learning/api.html). This means there are no directories but only flat keys with prefixes in etcd3. To accomodate lookups, etcdv3 plugin now does a lookup on prefix `/skydns/test/skydns/mx/` to search for entries like `/skydns/test/skydns/mx/a` etc, and if there is nothing found on `/skydns/test/skydns/mx/`, it looks for `/skydns/test/skydns/mx` to find entries like `/skydns/test/skydns/mx1`.
With etcd3, support for [hierarchial keys are dropped](https://coreos.com/etcd/docs/latest/learning/api.html). This means there are no directories but only flat keys with prefixes in etcd3. To accommodate lookups, etcdv3 plugin now does a lookup on prefix `/skydns/test/skydns/mx/` to search for entries like `/skydns/test/skydns/mx/a` etc, and if there is nothing found on `/skydns/test/skydns/mx/`, it looks for `/skydns/test/skydns/mx` to find entries like `/skydns/test/skydns/mx1`.

This causes two lookups from CoreDNS to etcdv3 in certain cases.

Expand Down
2 changes: 1 addition & 1 deletion plugin/etcd/msg/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func targetStrip(name string, targetStrip int) string {
offset, end = dns.NextLabel(name, offset)
}
if end {
// We overshot the name, use the orignal one.
// We overshot the name, use the original one.
offset = 0
}
name = name[offset:]
Expand Down
2 changes: 1 addition & 1 deletion plugin/file/secondary.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func less(a, b uint32) bool {

// Update updates the secondary zone according to its SOA. It will run for the life time of the server
// and uses the SOA parameters. Every refresh it will check for a new SOA number. If that fails (for all
// server) it wil retry every retry interval. If the zone failed to transfer before the expire, the zone
// server) it will retry every retry interval. If the zone failed to transfer before the expire, the zone
// will be marked expired.
func (z *Zone) Update() error {
// If we don't have a SOA, we don't have a zone, wait for it to appear.
Expand Down
2 changes: 1 addition & 1 deletion plugin/file/secondary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// TODO(miek): should test notifies as well, ie start test server (a real coredns one)...
// setup other test server that sends notify, see if CoreDNS comes calling for a zone
// tranfer
// transfer

func TestLess(t *testing.T) {
const (
Expand Down
2 changes: 1 addition & 1 deletion plugin/file/xfr.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in
return dns.RcodeSuccess, nil
}

// Name implements the plugin.Hander interface.
// Name implements the plugin.Handler interface.
func (x Xfr) Name() string { return "xfr" }

const transferLength = 1000 // Start a new envelop after message reaches this size in bytes. Intentionally small to test multi envelope parsing.
2 changes: 1 addition & 1 deletion plugin/forward/connect.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package forward implements a forwarding proxy. It caches an upstream net.Conn for some time, so if the same
// client returns the upstream's Conn will be precached. Depending on how you benchmark this looks to be
// 50% faster than just openening a new connection for every client. It works with UDP and TCP and uses
// 50% faster than just opening a new connection for every client. It works with UDP and TCP and uses
// inband healthchecking.
package forward

Expand Down
2 changes: 1 addition & 1 deletion plugin/forward/forward.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package forward implements a forwarding proxy. It caches an upstream net.Conn for some time, so if the same
// client returns the upstream's Conn will be precached. Depending on how you benchmark this looks to be
// 50% faster than just openening a new connection for every client. It works with UDP and TCP and uses
// 50% faster than just opening a new connection for every client. It works with UDP and TCP and uses
// inband healthchecking.
package forward

Expand Down
2 changes: 1 addition & 1 deletion plugin/forward/lookup.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package forward implements a forwarding proxy. It caches an upstream net.Conn for some time, so if the same
// client returns the upstream's Conn will be precached. Depending on how you benchmark this looks to be
// 50% faster than just openening a new connection for every client. It works with UDP and TCP and uses
// 50% faster than just opening a new connection for every client. It works with UDP and TCP and uses
// inband healthchecking.
package forward

Expand Down
2 changes: 1 addition & 1 deletion plugin/forward/truncated.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/miekg/dns"
)

// truncated looks at the error and if truncated return a nil errror
// truncated looks at the error and if truncated return a nil error
// and a possible reconstructed dns message if that was nil.
func truncated(state request.Request, ret *dns.Msg, err error) (*dns.Msg, error) {
// If you query for instance ANY isc.org; you get a truncated query back which miekg/dns fails to unpack
Expand Down
2 changes: 1 addition & 1 deletion plugin/hosts/hostsfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (h *hostsMap) Len() int {
type Hostsfile struct {
sync.RWMutex

// list of zones we are authoritive for
// list of zones we are authoritative for
Origins []string

// hosts maps for lookups
Expand Down
2 changes: 1 addition & 1 deletion plugin/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ kubernetes [ZONES...] {
* `noendpoints` will turn off the serving of endpoint records by disabling the watch on endpoints.
All endpoint queries and headless service queries will result in an NXDOMAIN.
* `transfer` enables zone transfers. It may be specified multiples times. `To` signals the direction
(only `to` is alllow). **ADDRESS** must be denoted in CIDR notation (127.0.0.1/32 etc.) or just as
(only `to` is allow). **ADDRESS** must be denoted in CIDR notation (127.0.0.1/32 etc.) or just as
plain addresses. The special wildcard `*` means: the entire internet.
Sending DNS notifies is not supported.
* `fallthrough` **[ZONES...]** If a query for a record in the zones for which the plugin is authoritative
Expand Down
2 changes: 1 addition & 1 deletion plugin/kubernetes/autopath.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (k *Kubernetes) AutoPath(state request.Request) []string {
}

search = append(search, k.autoPathSearch...)
search = append(search, "") // sentinal
search = append(search, "") // sentinel
return search
}

Expand Down
8 changes: 4 additions & 4 deletions plugin/kubernetes/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func TestKubernetesParse(t *testing.T) {
tests := []struct {
input string // Corefile data as string
shouldErr bool // true if test case is exected to produce an error.
shouldErr bool // true if test case is expected to produce an error.
expectedErrContent string // substring from the expected error. Empty for positive cases.
expectedZoneCount int // expected count of defined zones.
expectedNSCount int // expected count of namespaces.
Expand Down Expand Up @@ -494,7 +494,7 @@ kubernetes cluster.local`,
func TestKubernetesParseEndpointPodNames(t *testing.T) {
tests := []struct {
input string // Corefile data as string
shouldErr bool // true if test case is exected to produce an error.
shouldErr bool // true if test case is expected to produce an error.
expectedErrContent string // substring from the expected error. Empty for positive cases.
expectedEndpointMode bool
}{
Expand Down Expand Up @@ -557,7 +557,7 @@ func TestKubernetesParseEndpointPodNames(t *testing.T) {
func TestKubernetesParseNoEndpoints(t *testing.T) {
tests := []struct {
input string // Corefile data as string
shouldErr bool // true if test case is exected to produce an error.
shouldErr bool // true if test case is expected to produce an error.
expectedErrContent string // substring from the expected error. Empty for positive cases.
expectedEndpointsInit bool
}{
Expand Down Expand Up @@ -619,7 +619,7 @@ func TestKubernetesParseNoEndpoints(t *testing.T) {
func TestKubernetesParseIgnoreEmptyService(t *testing.T) {
tests := []struct {
input string // Corefile data as string
shouldErr bool // true if test case is exected to produce an error.
shouldErr bool // true if test case is expected to produce an error.
expectedErrContent string // substring from the expected error. Empty for positive cases.
expectedEndpointsInit bool
}{
Expand Down
2 changes: 1 addition & 1 deletion plugin/metadata/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// Basic example:
//
// Implement the Provder interface for a plugin:
// Implement the Provider interface for a plugin:
//
// func (p P) Metadata(ctx context.Context, state request.Request) context.Context {
// cached := ""
Expand Down
2 changes: 1 addition & 1 deletion plugin/metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Use an alternative address:
}
~~~

Or via an enviroment variable (this is supported throughout the Corefile): `export PORT=9253`, and
Or via an environment variable (this is supported throughout the Corefile): `export PORT=9253`, and
then:

~~~ corefile
Expand Down
2 changes: 1 addition & 1 deletion plugin/metrics/vars/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/miekg/dns"
)

// Report reports the metrics data associcated with request.
// Report reports the metrics data associated with request.
func Report(ctx context.Context, req request.Request, zone, rcode string, size int, start time.Time) {
// Proto and Family.
net := req.Proto()
Expand Down
2 changes: 1 addition & 1 deletion plugin/pkg/doh/doh.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewRequest(method, url string, m *dns.Msg) (*http.Request, error) {

}

// ResponseToMsg converts a http.Repsonse to a dns message.
// ResponseToMsg converts a http.Response to a dns message.
func ResponseToMsg(resp *http.Response) (*dns.Msg, error) {
defer resp.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion plugin/pkg/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Probe struct {
// Func is used to determine if a target is alive. If so this function must return nil.
type Func func() error

// New returns a pointer to an intialized Probe.
// New returns a pointer to an initialized Probe.
func New() *Probe { return &Probe{} }

// Do will probe target, if a probe is already in progress this is a noop.
Expand Down
2 changes: 1 addition & 1 deletion plugin/pkg/watch/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (w *Manager) Stop() {
wr := pb.WatchResponse{WatchId: id, Canceled: true}
err := stream.Send(&wr)
if err != nil {
log.Warningf("Error notifiying client of cancellation: %s\n", err)
log.Warningf("Error notifying client of cancellation: %s\n", err)
}
}
delete(w.watches, wn)
Expand Down
2 changes: 1 addition & 1 deletion plugin/proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ If monitoring is enabled (via the *prometheus* directive) then the following met
Where `proxy_proto` is the protocol used (`dns` or `grpc`) and `to` is **TO**
specified in the config, `proto` is the protocol used by the incoming query ("tcp" or "udp"), family
the transport family ("1" for IPv4, and "2" for IPv6). `Server` is the server responsible for the
request (and metric). See the documention in the metrics plugin.
request (and metric). See the documentation in the metrics plugin.

## Examples

Expand Down
2 changes: 1 addition & 1 deletion plugin/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
// Note this keeps looping and trying until tryDuration is hit, at which point our client
// might be long gone...
if oe.Timeout() {
// Our upstream's upstream is problably messing up, continue with next selected
// Our upstream's upstream is probably messing up, continue with next selected
// host - which my be the *same* one as we don't set any uh.Fails.
continue
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/proxy/upstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ junky resolv.conf

path, rm, err := test.TempFile(".", tc.filedata)
if err != nil {
t.Fatalf("Test %d could not creat temp file %v", i, err)
t.Fatalf("Test %d could not create temp file %v", i, err)
}
defer rm()

Expand Down
2 changes: 1 addition & 1 deletion plugin/reload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ is already listening on that port. The process reloads and performs the followin
3. fail to start a new listener on 443
4. fail loading the new Corefile, abort and keep using the old process

After the aborted attempt to reload we are left with the old proceses running, but the listener is
After the aborted attempt to reload we are left with the old processes running, but the listener is
closed in step 1; so the health endpoint is broken. The same can hopen in the prometheus metrics plugin.

In general be careful with assigning new port and expecting reload to work fully.
2 changes: 1 addition & 1 deletion plugin/rewrite/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (rule *substringNameRule) GetResponseRule() ResponseRule { return ResponseR
// GetResponseRule return a rule to rewrite the response with.
func (rule *regexNameRule) GetResponseRule() ResponseRule { return rule.ResponseRule }

// validName returns true if s is valid domain name and shortern than 256 characters.
// validName returns true if s is valid domain name and shorter than 256 characters.
func validName(s string) bool {
_, ok := dns.IsDomainName(s)
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion plugin/root/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestRoot(t *testing.T) {
}
}

// getTempDirPath returnes the path to the system temp directory. If it does not exists - an error is returned.
// getTempDirPath returns the path to the system temp directory. If it does not exist - an error is returned.
func getTempDirPath() (string, error) {
tempDir := os.TempDir()
_, err := os.Stat(tempDir)
Expand Down
10 changes: 5 additions & 5 deletions plugin/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestHandler(t *testing.T) {
return fmt.Errorf("expected 1 answer, got %v", len(r.Answer))
}
if r.Answer[0].Header().Rrtype != dns.TypeA {
return fmt.Errorf("expected an A record anwser, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
return fmt.Errorf("expected an A record answer, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
}
if r.Answer[0].(*dns.A).A.String() != "10.95.12.8" {
return fmt.Errorf("expected an A record for 10.95.12.8, got %v", r.Answer[0].String())
Expand All @@ -206,7 +206,7 @@ func TestHandler(t *testing.T) {
return fmt.Errorf("expected 1 answer, got %v", len(r.Answer))
}
if r.Answer[0].Header().Rrtype != dns.TypeMX {
return fmt.Errorf("expected an A record anwser, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
return fmt.Errorf("expected an A record answer, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
}
if len(r.Extra) != 1 {
return fmt.Errorf("expected 1 extra record, got %v", len(r.Extra))
Expand All @@ -228,7 +228,7 @@ func TestHandler(t *testing.T) {
return fmt.Errorf("expected 1 answer, got %v", len(r.Answer))
}
if r.Answer[0].Header().Rrtype != dns.TypeA {
return fmt.Errorf("expected an A record anwser, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
return fmt.Errorf("expected an A record answer, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
}
if len(r.Extra) != 1 {
return fmt.Errorf("expected 1 extra record, got %v", len(r.Extra))
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestHandler(t *testing.T) {
return fmt.Errorf("expected 1 answer, got %v", len(r.Answer))
}
if r.Answer[0].Header().Rrtype != dns.TypeSOA {
return fmt.Errorf("expected an SOA record anwser, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
return fmt.Errorf("expected an SOA record answer, got %v", dns.TypeToString[r.Answer[0].Header().Rrtype])
}
return nil
},
Expand Down Expand Up @@ -338,7 +338,7 @@ func TestMultiSection(t *testing.T) {
template CH TXT coredns.invalid {
answer "{{ .Name }} 60 CH TXT \"test\""
}
# Anwser example. ip templates and fallthrough otherwise
# Answer example. ip templates and fallthrough otherwise
template IN A example {
match ^ip-10-(?P<b>[0-9]*)-(?P<c>[0-9]*)-(?P<d>[0-9]*)[.]example[.]$
answer "{{ .Name }} 60 IN A 10.{{ .Group.b }}.{{ .Group.c }}.{{ .Group.d }}"
Expand Down
2 changes: 1 addition & 1 deletion request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (r *Request) Scrub(reply *dns.Msg) (*dns.Msg, Result) {
sub = optLen
}

// substract to make spaces for re-added EDNS0 OPT RR.
// subtract to make spaces for re-added EDNS0 OPT RR.
re := len(reply.Extra) - sub
size -= sub

Expand Down
2 changes: 1 addition & 1 deletion test/proxy_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestProxyThreeWay(t *testing.T) {
continue
}
// We would previously get SERVFAIL, so just getting answers here
// is a good sign. The actuall timeouts are handled in the err != nil case
// is a good sign. The actual timeouts are handled in the err != nil case
// above.
if r.Rcode != dns.RcodeSuccess {
t.Fatalf("Expected success rcode, got %d", r.Rcode)
Expand Down
2 changes: 1 addition & 1 deletion test/readme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func corefileFromReadme(readme string) ([]*Input, error) {
}

if corefile {
temp += line + "\n" // readd newline stripped by s.Text()
temp += line + "\n" // read newline stripped by s.Text()
}
}

Expand Down

0 comments on commit 6d8a078

Please sign in to comment.