Skip to content

Fix typos in multiple files #22322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ RUN mkdir -p /consul/data && \
chown -R consul:consul /consul

# set up nsswitch.conf for Go's "netgo" implementation which is used by Consul,
# otherwise DNS supercedes the container's hosts file, which we don't want.
# otherwise DNS supersedes the container's hosts file, which we don't want.
RUN test -e /etc/nsswitch.conf || echo 'hosts: files dns' > /etc/nsswitch.conf

# Expose the consul data directory as a volume since there's mutable state in there.
Expand Down Expand Up @@ -182,7 +182,7 @@ RUN mkdir -p /consul/data && \
chown -R consul:consul /consul

# Set up nsswitch.conf for Go's "netgo" implementation which is used by Consul,
# otherwise DNS supercedes the container's hosts file, which we don't want.
# otherwise DNS supersedes the container's hosts file, which we don't want.
RUN test -e /etc/nsswitch.conf || echo 'hosts: files dns' > /etc/nsswitch.conf

# Expose the consul data directory as a volume since there's mutable state in there.
Expand Down Expand Up @@ -283,7 +283,7 @@ RUN mkdir -p /consul/data && \
chgrp -R 0 /consul && chmod -R g+rwX /consul

# set up nsswitch.conf for Go's "netgo" implementation which is used by Consul,
# otherwise DNS supercedes the container's hosts file, which we don't want.
# otherwise DNS supersedes the container's hosts file, which we don't want.
RUN test -e /etc/nsswitch.conf || echo 'hosts: files dns' > /etc/nsswitch.conf

# Expose the consul data directory as a volume since there's mutable state in there.
Expand Down
2 changes: 1 addition & 1 deletion acl/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Config struct {
// WildcardName is the string that represents a request to authorize a wildcard permission
WildcardName string

//by default errors, but in certain instances we want to make sure to maintain backwards compatabilty
//by default errors, but in certain instances we want to make sure to maintain backwards compatibility
WarnOnDuplicateKey bool

// embedded enterprise configuration
Expand Down
12 changes: 6 additions & 6 deletions agent/agent_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestAgent_Services_ExternalConnectProxy(t *testing.T) {
assert.Equal(t, srv1.Proxy.ToAPI(), actual.Proxy)
}

// Thie tests that a sidecar-registered service is returned as expected.
// The tests that a sidecar-registered service is returned as expected.
func TestAgent_Services_Sidecar(t *testing.T) {
if testing.Short() {
t.Skip("too slow for testing.Short")
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestAgent_Services_Sidecar(t *testing.T) {
// Sanity check that LocalRegisteredAsSidecar is not in the output (assuming
// JSON encoding). Right now this is not the case because the services
// endpoint happens to use the api struct which doesn't include that field,
// but this test serves as a regression test incase we change the endpoint to
// but this test serves as a regression test in case we change the endpoint to
// return the internal struct later and accidentally expose some "internal"
// state.
assert.NotContains(t, resp.Body.String(), "LocallyRegisteredAsSidecar")
Expand Down Expand Up @@ -647,7 +647,7 @@ func TestAgent_Service(t *testing.T) {
{
// This test exercises a case that caused a busy loop to eat CPU for the
// entire duration of the blocking query. If a service gets re-registered
// wth same proxy config then the old proxy config chan is closed causing
// with same proxy config then the old proxy config chan is closed causing
// blocked watchset.Watch to return false indicating a change. But since
// the hash is the same when the blocking fn is re-called we should just
// keep blocking on the next iteration. The bug hit was that the WatchSet
Expand Down Expand Up @@ -682,7 +682,7 @@ func TestAgent_Service(t *testing.T) {
// When we reload config, the agent pauses Anti-entropy, then clears all
// services (which causes their watch chans to be closed) before loading
// state from config/snapshot again). If we do that naively then we don't
// just get a spurios wakeup on the watch if the service didn't change,
// just get a spurious wakeup on the watch if the service didn't change,
// but we get it wakeup and then race with the reload and probably see no
// services and return a 404 error which is gross. This test exercises
// that - even though the registrations were from API not config, they are
Expand Down Expand Up @@ -2955,7 +2955,7 @@ func TestAgent_RegisterCheck_Passing(t *testing.T) {
resp := httptest.NewRecorder()
a.srv.h.ServeHTTP(resp, req)
if http.StatusOK != resp.Code {
t.Fatalf("expcted 200 but got %v", resp.Code)
t.Fatalf("expected 200 but got %v", resp.Code)
}

// Ensure we have a check mapping
Expand Down Expand Up @@ -8333,7 +8333,7 @@ func TestAgent_Version(t *testing.T) {
assert.NotNil(t, obj.HumanVersion)
}

// Thie tests that a proxy with an ExposeConfig is returned as expected.
// The tests that a proxy with an ExposeConfig is returned as expected.
func TestAgent_Services_ExposeConfig(t *testing.T) {
if testing.Short() {
t.Skip("too slow for testing.Short")
Expand Down
6 changes: 3 additions & 3 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func testAgent_AddService(t *testing.T, extraHCL string) {
CheckID: "check1",
Name: "name1",
Interval: "",
Timeout: "", // these are empty bcause a TTL was provided
Timeout: "", // these are empty because a TTL was provided
Status: "critical",
Notes: "note1",
ServiceID: "svcid2",
Expand All @@ -608,7 +608,7 @@ func testAgent_AddService(t *testing.T, extraHCL string) {
CheckID: "service:svcid2:3",
Name: "check-noid",
Interval: "",
Timeout: "", // these are empty becuase a TTL was provided
Timeout: "", // these are empty because a TTL was provided
Status: "critical",
ServiceID: "svcid2",
ServiceName: "svcname2",
Expand Down Expand Up @@ -1355,7 +1355,7 @@ func testAgent_RemoveService(t *testing.T, extraHCL string) {
t.Fatalf("err: %v", err)
}

// add another service that wont be affected
// add another service that won't be affected
srv = &structs.NodeService{
ID: "mysql",
Service: "mysql",
Expand Down
2 changes: 1 addition & 1 deletion agent/catalog_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestCatalogRegister_PeeringRegistration(t *testing.T) {
})

t.Run("cannot hcl set the peer registrations config", func(t *testing.T) {
// this will have no effect, as the value is overriden in non user source
// this will have no effect, as the value is overridden in non user source
a := NewTestAgent(t, "peering = { test_allow_peer_registrations = true }")
defer a.Shutdown()

Expand Down
7 changes: 4 additions & 3 deletions agent/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import (
"encoding/hex"
"errors"
"fmt"
agentdns "github.com/hashicorp/consul/agent/dns"
"math"
"net"
"regexp"
"strings"
"sync/atomic"
"time"

agentdns "github.com/hashicorp/consul/agent/dns"

"github.com/armon/go-metrics"
"github.com/armon/go-radix"
"github.com/hashicorp/go-hclog"
Expand Down Expand Up @@ -49,8 +50,8 @@ const (

// If a consumer sets a buffer size greater than this amount we will default it down
// to this amount to ensure that consul does respond. Previously if consumer had a larger buffer
// size than 65535 - 60 bytes (maximim 60 bytes for IP header. UDP header will be offset in the
// trimUDP call) consul would fail to respond and the consumer timesout
// size than 65535 - 60 bytes (maximum 60 bytes for IP header. UDP header will be offset in the
// trimUDP call) consul would fail to respond and the consumer timeout
// the request.
maxUDPDatagramSize = math.MaxUint16 - 68
)
Expand Down
2 changes: 1 addition & 1 deletion agent/health_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func getBoolQueryParam(params url.Values, key string) (bool, error) {
var param bool
if _, ok := params[key]; ok {
val := params.Get(key)
// Orginally a comment declared this check should be removed after Consul
// Originally a comment declared this check should be removed after Consul
// 0.10, to no longer support using ?passing without a value. However, I
// think this is a reasonable experience for a user and so am keeping it
// here.
Expand Down
2 changes: 1 addition & 1 deletion agent/health_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ func TestHealthServiceNodes_CheckType(t *testing.T) {

for _, check := range nodes[0].Checks {
if check.Name == "consul check" && check.Type != "grpc" {
t.Fatalf("exptected grpc check type, got %s", check.Type)
t.Fatalf("expected grpc check type, got %s", check.Type)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions agent/http_decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2253,8 +2253,8 @@ func TestDecodeTxnConvertOps(t *testing.T) {
// Helper funcs:
// =========================================

// checkTypeDurationTest is a helper func to test durations in CheckTYpe or CheckDefiniton
// (to reduce repetetive typing).
// checkTypeDurationTest is a helper func to test durations in CheckType or CheckDefinition
// (to reduce repetitive typing).
func checkTypeDurationTest(check interface{}, want time.Duration, prefix string) error {
// check for pointers first
switch v := check.(type) {
Expand Down Expand Up @@ -2302,8 +2302,8 @@ func checkTypeDurationTest(check interface{}, want time.Duration, prefix string)
return nil
}

// checkTypeDurationTest is a helper func to test the Header map in a CheckType or CheckDefiniton
// (to reduce repetetive typing).
// checkTypeDurationTest is a helper func to test the Header map in a CheckType or CheckDefinition
// (to reduce repetitive typing).
func checkTypeHeaderTest(check interface{}, want map[string][]string) error {

var header map[string][]string
Expand Down
2 changes: 1 addition & 1 deletion agent/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ func TestParseConsistencyAndMaxStale(t *testing.T) {
ensureConsistency(t, a, "/v1/catalog/nodes?max_stale=3s", 3*time.Second, false)
ensureConsistency(t, a, "/v1/catalog/nodes?stale&max_stale=3s", 3*time.Second, false)

// stale by defaul on discovery
// stale by default on discovery
a.config.DiscoveryMaxStale = 7 * time.Second
ensureConsistency(t, a, "/v1/catalog/nodes", a.config.DiscoveryMaxStale, false)
// Not in KV
Expand Down
2 changes: 1 addition & 1 deletion agent/txn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestTxnEndpoint_Bad_Size_Item(t *testing.T) {
t.Fatalf("expected 413 but got %d", httpErr.StatusCode)
}
} else {
t.Fatalf("excected HTTP error but got %v", err)
t.Fatalf("expected HTTP error but got %v", err)
}
}
}
Expand Down