From 2fe5890d8b7fc7801d308dbb51bf29c57ee9a92b Mon Sep 17 00:00:00 2001 From: Zhizhen He Date: Thu, 10 Aug 2023 23:06:48 +0800 Subject: [PATCH] Fix typos (#6235) * Fix typos and add todo to fix spelling of dnsutil.MaximumDefaulTTL Signed-off-by: Zhizhen He --- plugin/bind/README.md | 2 +- plugin/cache/cache_test.go | 2 +- plugin/kubernetes/ns_test.go | 2 +- plugin/loadbalance/weighted.go | 2 +- plugin/pkg/dnsutil/ttl.go | 1 + plugin/pkg/log/listener_test.go | 4 ++-- plugin/pkg/up/up.go | 6 +++--- plugin/rewrite/README.md | 2 +- plugin/rewrite/cname_target.go | 2 +- plugin/template/cname_test.go | 4 ++-- plugin/transfer/transfer.go | 2 +- test/presubmit_test.go | 2 +- test/tsig_test.go | 8 ++++---- 13 files changed, 20 insertions(+), 19 deletions(-) diff --git a/plugin/bind/README.md b/plugin/bind/README.md index a911218f6..1c0f0c5f9 100644 --- a/plugin/bind/README.md +++ b/plugin/bind/README.md @@ -13,7 +13,7 @@ If several addresses are provided, a listener will be open on each of the IP pro Each address has to be an IP or name of one of the interfaces of the host. Bind by interface name, binds to the IPs on that interface at the time of startup or reload (reload will happen with a SIGHUP or if the config file changes). -If the given argument is an interface name, and that interface has serveral IP addresses, CoreDNS will listen on all of the interface IP addresses (including IPv4 and IPv6), except for IPv6 link-local addresses on that interface. +If the given argument is an interface name, and that interface has several IP addresses, CoreDNS will listen on all of the interface IP addresses (including IPv4 and IPv6), except for IPv6 link-local addresses on that interface. ## Syntax diff --git a/plugin/cache/cache_test.go b/plugin/cache/cache_test.go index 5a023f400..629a83e34 100644 --- a/plugin/cache/cache_test.go +++ b/plugin/cache/cache_test.go @@ -671,7 +671,7 @@ func TestCacheWildcardMetadata(t *testing.T) { _, k := key(qname, w.Msg, response.NoError, state.Do()) i, _ := c.pcache.Get(k) if i.(*item).wildcard != wildcard { - t.Errorf("expected wildcard reponse to enter cache with cache item's wildcard = %q, got %q", wildcard, i.(*item).wildcard) + t.Errorf("expected wildcard response to enter cache with cache item's wildcard = %q, got %q", wildcard, i.(*item).wildcard) } // 2. Test retrieving the cached item from cache and writing its wildcard value to metadata diff --git a/plugin/kubernetes/ns_test.go b/plugin/kubernetes/ns_test.go index e3c67d4f3..bdf326e52 100644 --- a/plugin/kubernetes/ns_test.go +++ b/plugin/kubernetes/ns_test.go @@ -142,7 +142,7 @@ func TestNsAddrsExternalHeadless(t *testing.T) { k.APIConn = &APIConnTest{} k.localIPs = []net.IP{net.ParseIP("10.244.0.20")} - // there are only headless sevices + // there are only headless services cdrs := k.nsAddrs(true, true, k.Zones[0]) if len(cdrs) != 1 { diff --git a/plugin/loadbalance/weighted.go b/plugin/loadbalance/weighted.go index bdd8232f8..2622509f4 100644 --- a/plugin/loadbalance/weighted.go +++ b/plugin/loadbalance/weighted.go @@ -162,7 +162,7 @@ func (w *weightedRR) topAddressIndex(address []dns.RR) int { w.mutex.Lock() defer w.mutex.Unlock() - // Dertermine the weight value for each address in the answer + // Determine the weight value for each address in the answer var wsum uint type waddress struct { index int diff --git a/plugin/pkg/dnsutil/ttl.go b/plugin/pkg/dnsutil/ttl.go index e2b26526d..c7f423a76 100644 --- a/plugin/pkg/dnsutil/ttl.go +++ b/plugin/pkg/dnsutil/ttl.go @@ -48,5 +48,6 @@ const ( // MinimalDefaultTTL is the absolute lowest TTL we use in CoreDNS. MinimalDefaultTTL = 5 * time.Second // MaximumDefaulTTL is the maximum TTL was use on RRsets in CoreDNS. + // TODO: rename as MaximumDefaultTTL MaximumDefaulTTL = 1 * time.Hour ) diff --git a/plugin/pkg/log/listener_test.go b/plugin/pkg/log/listener_test.go index 0df03b446..452d2b38d 100644 --- a/plugin/pkg/log/listener_test.go +++ b/plugin/pkg/log/listener_test.go @@ -11,7 +11,7 @@ func TestRegisterAndDeregisterListener(t *testing.T) { for _, name := range []string{"listener1", "listener2", "listener1"} { err := RegisterListener(NewMockListener(name)) if err != nil { - t.Errorf("RegsiterListener Error %s", err) + t.Errorf("RegisterListener Error %s", err) } } if len(ls.listeners) != 2 { @@ -46,7 +46,7 @@ func testListenersCalled(t *testing.T, listenerNames []string, outputs []string) for _, name := range listenerNames { err := RegisterListener(NewMockListener(name)) if err != nil { - t.Errorf("RegsiterListener Error %s", err) + t.Errorf("RegisterListener Error %s", err) } } var f bytes.Buffer diff --git a/plugin/pkg/up/up.go b/plugin/pkg/up/up.go index 6f18ffb70..649107f59 100644 --- a/plugin/pkg/up/up.go +++ b/plugin/pkg/up/up.go @@ -10,9 +10,9 @@ import ( // Probe is used to run a single Func until it returns true (indicating a target is healthy). If an Func // is already in progress no new one will be added, i.e. there is always a maximum of 1 checks in flight. // -// There is a tradeoff to be made in figuring out quickly that an upstream is healthy and not doing to much work -// (sending queries) to find that out. Having some kind of exp. backoff here won't help much, because you don't won't -// to backoff too much. You then also need random queries to be perfomed every so often to quickly detect a working +// There is a tradeoff to be made in figuring out quickly that an upstream is healthy and not doing much work +// (sending queries) to find that out. Having some kind of exp. backoff here won't help much, because you don't want +// to backoff too much. You then also need random queries to be performed every so often to quickly detect a working // upstream. In the end we just send a query every 0.5 second to check the upstream. This hopefully strikes a balance // between getting information about the upstream state quickly and not doing too much work. Note that 0.5s is still an // eternity in DNS, so we may actually want to shorten it. diff --git a/plugin/rewrite/README.md b/plugin/rewrite/README.md index ef938e79d..f9826cf22 100644 --- a/plugin/rewrite/README.md +++ b/plugin/rewrite/README.md @@ -407,7 +407,7 @@ rewrite edns0 subnet set 24 56 * If the query's source IP address is an IPv6 address, the first 56 bits in the IP will be the network subnet. -### CNAME Feild Rewrites +### CNAME Field Rewrites There might be a scenario where you want the `CNAME` target of the response to be rewritten. You can do this by using the `CNAME` field rewrite. This will generate new answer records according to the new `CNAME` target. diff --git a/plugin/rewrite/cname_target.go b/plugin/rewrite/cname_target.go index c7d93e8a7..068f17fdd 100644 --- a/plugin/rewrite/cname_target.go +++ b/plugin/rewrite/cname_target.go @@ -88,7 +88,7 @@ func (r *cnameTargetRule) RewriteResponse(res *dns.Msg, rr dns.RR) { newAnswer = append(newAnswer, rr) } } - // iterate over upstream response recieved + // iterate over upstream response received for _, rr := range upRes.Answer { if rr.Header().Name == toTarget { newAnswer = append(newAnswer, rr) diff --git a/plugin/template/cname_test.go b/plugin/template/cname_test.go index c7e81df23..6ce6d7d2d 100644 --- a/plugin/template/cname_test.go +++ b/plugin/template/cname_test.go @@ -46,10 +46,10 @@ func TestTruncatedCNAME(t *testing.T) { _, err := handler.ServeDNS(context.TODO(), w, r) if err != nil { - t.Fatalf("Unexpecetd error %q", err) + t.Fatalf("Unexpected error %q", err) } if w.Msg == nil { - t.Fatalf("Unexpecetd empty response.") + t.Fatalf("Unexpected empty response.") } if !w.Msg.Truncated { t.Error("Expected reply to be marked truncated.") diff --git a/plugin/transfer/transfer.go b/plugin/transfer/transfer.go index 71136e1de..f0b42e9b6 100644 --- a/plugin/transfer/transfer.go +++ b/plugin/transfer/transfer.go @@ -36,7 +36,7 @@ type Transferer interface { // // If serial is 0, handle as an AXFR request. Transfer should send all records // in the zone to the channel. The SOA should be written to the channel first, followed - // by all other records, including all NS + glue records. The implemenation is also responsible + // by all other records, including all NS + glue records. The implementation is also responsible // for sending the last SOA record (to signal end of the transfer). This plugin will just grab // these records and send them back to the requester, there is little validation done. // diff --git a/test/presubmit_test.go b/test/presubmit_test.go index a0b712e85..0d7dc4fcd 100644 --- a/test/presubmit_test.go +++ b/test/presubmit_test.go @@ -260,7 +260,7 @@ func (w *testImportOrderingWalker) walk(path string, info os.FileInfo, _ error) } // Ok, now that we have the type, let's see if all members adhere to it. - // After that we check if the are in the right order. + // After that we check if they are in the right order. for i := 0; i <= bl; i++ { for _, p := range blocks[i] { t := importtype(p.Path.Value) diff --git a/test/tsig_test.go b/test/tsig_test.go index 19d5d0379..f126f792b 100644 --- a/test/tsig_test.go +++ b/test/tsig_test.go @@ -40,7 +40,7 @@ func TestTsig(t *testing.T) { } tsig := r.IsTsig() if tsig == nil { - t.Fatalf("Respose was not TSIG") + t.Fatalf("Response was not TSIG") } if tsig.Error != dns.RcodeSuccess { t.Fatalf("TSIG Error code should be dns.RcodeSuccess") @@ -70,7 +70,7 @@ func TestTsigBadKey(t *testing.T) { } tsig := r.IsTsig() if tsig == nil { - t.Fatalf("Respose was not TSIG") + t.Fatalf("Response was not TSIG") } if tsig.Error != dns.RcodeBadKey { t.Fatalf("TSIG Error code should be dns.RcodeBadKey") @@ -109,7 +109,7 @@ func TestTsigBadSig(t *testing.T) { } tsig := r.IsTsig() if tsig == nil { - t.Fatalf("Respose was not TSIG") + t.Fatalf("Response was not TSIG") } if tsig.Error != dns.RcodeBadSig { t.Fatalf("TSIG Error code should be dns.RcodeBadSig") @@ -149,7 +149,7 @@ func TestTsigBadTime(t *testing.T) { } tsig := r.IsTsig() if tsig == nil { - t.Fatalf("Respose was not TSIG") + t.Fatalf("Response was not TSIG") } if tsig.Error != dns.RcodeBadTime { t.Fatalf("TSIG Error code should be dns.RcodeBadTime")