From a5d57f5326482a0ba4fbd8869eef66e041a099b9 Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" Date: Fri, 2 Nov 2018 12:00:39 -0500 Subject: [PATCH] fix comment typos (#4890) --- agent/agent_endpoint_test.go | 2 +- agent/consul/acl_endpoint.go | 8 ++++---- agent/consul/acl_server.go | 4 ++-- agent/consul/fsm/commands_oss.go | 2 +- agent/consul/leader.go | 2 +- agent/debug/host.go | 2 +- agent/structs/acl.go | 5 +++-- command/acl/acl.go | 10 +++++----- command/acl/policy/create/policy_create.go | 16 ++++++++-------- command/acl/policy/list/policy_list.go | 2 +- command/acl/policy/policy.go | 10 +++++----- command/acl/policy/read/policy_read.go | 2 +- command/acl/policy/update/policy_update.go | 2 +- .../docs/commands/acl/acl-policy.html.md.erb | 6 +++--- .../docs/commands/acl/acl-token.html.md.erb | 2 +- 15 files changed, 38 insertions(+), 37 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index f353360bb..07acd6e5d 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -176,7 +176,7 @@ func TestAgent_Services_Sidecar(t *testing.T) { assert.Equal(srv1.Proxy.DestinationServiceName, actual.ProxyDestination) // Sanity check that LocalRegisteredAsSidecar is not in the output (assuming - // JSON encoding). Right now this is not the case becuase the services + // 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 // return the internal struct later and accidentally expose some "internal" diff --git a/agent/consul/acl_endpoint.go b/agent/consul/acl_endpoint.go index badb89039..6ebbf89f0 100644 --- a/agent/consul/acl_endpoint.go +++ b/agent/consul/acl_endpoint.go @@ -126,7 +126,7 @@ func (a *ACL) BootstrapTokens(args *structs.DCSpecificRequest, reply *structs.AC // remove the bootstrap override file now that we have the index from it and it was valid. // whether bootstrapping works or not is irrelevant as we really don't want this file hanging around // in case a snapshot restore is done. In that case we don't want to accidentally allow re-bootstrapping - // just becuase the file was unchanged. + // just because the file was unchanged. a.removeBootstrapResetFile() accessor, err := lib.GenerateUUID(a.srv.checkTokenUUID) @@ -181,7 +181,7 @@ func (a *ACL) TokenRead(args *structs.ACLTokenGetRequest, reply *structs.ACLToke } // clients will not know whether the server has local token store. In the case - // where it doesnt' we will transparently forward requests. + // where it doesn't we will transparently forward requests. if !a.srv.LocalTokensEnabled() { args.Datacenter = a.srv.config.ACLDatacenter } @@ -233,7 +233,7 @@ func (a *ACL) TokenClone(args *structs.ACLTokenSetRequest, reply *structs.ACLTok } // clients will not know whether the server has local token store. In the case - // where it doesnt' we will transparently forward requests. + // where it doesn't we will transparently forward requests. if !a.srv.LocalTokensEnabled() { args.Datacenter = a.srv.config.ACLDatacenter } @@ -733,7 +733,7 @@ func (a *ACL) PolicySet(args *structs.ACLPolicySetRequest, reply *structs.ACLPol return err } - // calcualte the hash for this policy + // calculate the hash for this policy policy.SetHash(true) req := &structs.ACLPolicyBatchSetRequest{ diff --git a/agent/consul/acl_server.go b/agent/consul/acl_server.go index c0129d266..54d6c9dd5 100644 --- a/agent/consul/acl_server.go +++ b/agent/consul/acl_server.go @@ -9,7 +9,7 @@ import ( ) var serverACLCacheConfig *structs.ACLCachesConfig = &structs.ACLCachesConfig{ - // The servers ACL caching has a few underlying assumptions: + // The server's ACL caching has a few underlying assumptions: // // 1 - All policies can be resolved locally. Hence we do not cache any // unparsed policies as we have memdb for that. @@ -17,7 +17,7 @@ var serverACLCacheConfig *structs.ACLCachesConfig = &structs.ACLCachesConfig{ // number of distinct policies and combined multi-policy authorizers // will be much less. // 3 - If you need more than 10k tokens cached then you should probably - // enabled token replication or be using DC local tokens. In both + // enable token replication or be using DC local tokens. In both // cases resolving the tokens from memdb will avoid the cache // entirely // diff --git a/agent/consul/fsm/commands_oss.go b/agent/consul/fsm/commands_oss.go index 27b280c33..b8471b12c 100644 --- a/agent/consul/fsm/commands_oss.go +++ b/agent/consul/fsm/commands_oss.go @@ -158,7 +158,7 @@ func (c *FSM) applyACLOperation(buf []byte, index uint64) interface{} { } return enabled case structs.ACLBootstrapNow: - // This a bootstrap request from a non-upgraded node + // This is a bootstrap request from a non-upgraded node if err := c.state.ACLBootstrap(index, 0, req.ACL.Convert(), true); err != nil { return err } diff --git a/agent/consul/leader.go b/agent/consul/leader.go index 2b94e71a8..71e615801 100644 --- a/agent/consul/leader.go +++ b/agent/consul/leader.go @@ -603,7 +603,7 @@ func (s *Server) startACLUpgrade() { var newTokens structs.ACLTokens for _, token := range tokens { - // This should be entirely unnessary but is just a small safeguard against changing accessor IDs + // This should be entirely unnecessary but is just a small safeguard against changing accessor IDs if token.AccessorID != "" { continue } diff --git a/agent/debug/host.go b/agent/debug/host.go index bbc242576..315f43120 100644 --- a/agent/debug/host.go +++ b/agent/debug/host.go @@ -11,7 +11,7 @@ import ( const ( // DiskUsagePath is the path to check usage of the disk. - // Must be a filessytem path such as "/", not device file path like "/dev/vda1" + // Must be a filesystem path such as "/", not device file path like "/dev/vda1" DiskUsagePath = "/" ) diff --git a/agent/structs/acl.go b/agent/structs/acl.go index f860e89a4..76f0e6915 100644 --- a/agent/structs/acl.go +++ b/agent/structs/acl.go @@ -52,7 +52,7 @@ const ( // dont accidentally create them when autogenerating uuids. // This policy gives unlimited access to everything. Users - // may rename if desired but cannot delete or modify the rules + // may rename if desired but cannot delete or modify the rules. ACLPolicyGlobalManagementID = "00000000-0000-0000-0000-000000000001" ACLPolicyGlobalManagement = ` acl = "write" @@ -82,6 +82,7 @@ session_prefix "" { }` // This is the policy ID for anonymous access. This is configurable by the + // user. ACLTokenAnonymousID = "00000000-0000-0000-0000-000000000002" ) @@ -308,7 +309,7 @@ type ACLPolicy struct { // The rule set (using the updated rule syntax) Rules string - // DEPRECATED (ACL-Legacy-Compat) - This is only needed while we support the legacy ACLS + // DEPRECATED (ACL-Legacy-Compat) - This is only needed while we support the legacy ACLs Syntax acl.SyntaxVersion `json:"-"` // Datacenters that the policy is valid within. diff --git a/command/acl/acl.go b/command/acl/acl.go index bf735b6eb..1b1f5491a 100644 --- a/command/acl/acl.go +++ b/command/acl/acl.go @@ -23,7 +23,7 @@ func (c *cmd) Help() string { return flags.Usage(help, nil) } -const synopsis = "Interact with the Consul's ACLs" +const synopsis = "Interact with Consul's ACLs" const help = ` Usage: consul acl [options] [args] @@ -41,10 +41,10 @@ Usage: consul acl [options] [args] Create a new ACL Policy: - $ consul acl policy create “new-policy” \ - -description “This is an example policy” \ - -datacenter “dc1” \ - -datacenter “dc2” \ + $ consul acl policy create "new-policy" \ + -description "This is an example policy" \ + -datacenter "dc1" \ + -datacenter "dc2" \ -rules @rules.hcl Set the default agent token: diff --git a/command/acl/policy/create/policy_create.go b/command/acl/policy/create/policy_create.go index 53f156ff6..e38a1c3a9 100644 --- a/command/acl/policy/create/policy_create.go +++ b/command/acl/policy/create/policy_create.go @@ -40,7 +40,7 @@ type cmd struct { func (c *cmd) init() { c.flags = flag.NewFlagSet("", flag.ContinueOnError) c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+ - "as the content hash and raft indices should be show for each entry") + "as the content hash and raft indices should be shown for each entry") c.flags.StringVar(&c.name, "name", "", "The new policies name. This flag is required.") c.flags.StringVar(&c.description, "description", "", "A description of the policy") c.flags.Var((*flags.AppendSliceValue)(&c.datacenters), "valid-datacenter", "Datacenter "+ @@ -142,15 +142,15 @@ Usage: consul acl policy create -name NAME [options] Create a new policy: - $ consul acl policy create -name “new-policy” \ - -description “This is an example policy” \ - -datacenter “dc1” \ - -datacenter “dc2” \ + $ consul acl policy create -name "new-policy" \ + -description "This is an example policy" \ + -datacenter "dc1" \ + -datacenter "dc2" \ -rules @rules.hcl Creation a policy from a legacy token: - $ consul acl policy create -name “legacy-policy” \ - -description “Token Converted to Policy” \ - -from-token “c1e34113-e7ab-4451-b1a6-336ddcc58fc6” + $ consul acl policy create -name "legacy-policy" \ + -description "Token Converted to Policy" \ + -from-token "c1e34113-e7ab-4451-b1a6-336ddcc58fc6" ` diff --git a/command/acl/policy/list/policy_list.go b/command/acl/policy/list/policy_list.go index 0d34cff44..27599ff44 100644 --- a/command/acl/policy/list/policy_list.go +++ b/command/acl/policy/list/policy_list.go @@ -27,7 +27,7 @@ type cmd struct { func (c *cmd) init() { c.flags = flag.NewFlagSet("", flag.ContinueOnError) c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+ - "as the content hash and raft indices should be show for each entry") + "as the content hash and raft indices should be shown for each entry") c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) diff --git a/command/acl/policy/policy.go b/command/acl/policy/policy.go index fa2efae2d..97c6f8770 100644 --- a/command/acl/policy/policy.go +++ b/command/acl/policy/policy.go @@ -33,10 +33,10 @@ Usage: consul acl policy [options] [args] Create a new ACL Policy: - $ consul acl policy create “new-policy” \ - -description “This is an example policy” \ - -datacenter “dc1” \ - -datacenter “dc2” \ + $ consul acl policy create "new-policy" \ + -description "This is an example policy" \ + -datacenter "dc1" \ + -datacenter "dc2" \ -rules @rules.hcl List all policies: @@ -44,7 +44,7 @@ Usage: consul acl policy [options] [args] Update a policy: - $ consul acl policy update “other-policy” -datacenter “dc1” + $ consul acl policy update "other-policy" -datacenter "dc1" Read a policy: diff --git a/command/acl/policy/read/policy_read.go b/command/acl/policy/read/policy_read.go index 25bc8c92a..ca95fe266 100644 --- a/command/acl/policy/read/policy_read.go +++ b/command/acl/policy/read/policy_read.go @@ -29,7 +29,7 @@ type cmd struct { func (c *cmd) init() { c.flags = flag.NewFlagSet("", flag.ContinueOnError) c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+ - "as the content hash and raft indices should be show for each entry") + "as the content hash and raft indices should be shown for each entry") c.flags.StringVar(&c.policyID, "id", "", "The ID of the policy to read. "+ "It may be specified as a unique ID prefix but will error if the prefix "+ "matches multiple policy IDs") diff --git a/command/acl/policy/update/policy_update.go b/command/acl/policy/update/policy_update.go index c289e7707..a75c122ef 100644 --- a/command/acl/policy/update/policy_update.go +++ b/command/acl/policy/update/policy_update.go @@ -40,7 +40,7 @@ type cmd struct { func (c *cmd) init() { c.flags = flag.NewFlagSet("", flag.ContinueOnError) c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+ - "as the content hash and raft indices should be show for each entry") + "as the content hash and raft indices should be shown for each entry") c.flags.StringVar(&c.policyID, "id", "", "The ID of the policy to update. "+ "It may be specified as a unique ID prefix but will error if the prefix "+ "matches multiple policy IDs") diff --git a/website/source/docs/commands/acl/acl-policy.html.md.erb b/website/source/docs/commands/acl/acl-policy.html.md.erb index f155d6770..53cf39fc1 100644 --- a/website/source/docs/commands/acl/acl-policy.html.md.erb +++ b/website/source/docs/commands/acl/acl-policy.html.md.erb @@ -80,7 +80,7 @@ Usage: `consul acl policy create [options] [args]` stdin or from a file. * `-meta` - Indicates that policy metadata such as the content hash and raft - indices should be show for each entry. + indices should be shown for each entry. * `-name=` - The new policies name. This flag is required. @@ -162,7 +162,7 @@ Usage: `consul acl policy read [options] [args]` prefix but will error if the prefix matches multiple policy IDs. * `-meta` - Indicates that policy metadata such as the content hash and raft - indices should be show for each entry. + indices should be shown for each entry. * `-name=` - The name of the policy to read. @@ -283,7 +283,7 @@ Usage: `consul acl policy update [options] [args]` unique ID prefix but will error if the prefix matches multiple policy IDs * `-meta` - Indicates that policy metadata such as the content hash and raft - indices should be show for each entry + indices should be shown for each entry * `-name=` - The policies name. diff --git a/website/source/docs/commands/acl/acl-token.html.md.erb b/website/source/docs/commands/acl/acl-token.html.md.erb index 9f5a7cd9f..6505e735d 100644 --- a/website/source/docs/commands/acl/acl-token.html.md.erb +++ b/website/source/docs/commands/acl/acl-token.html.md.erb @@ -167,7 +167,7 @@ Usage: `consul acl token read [options] [args]` prefix but will error if the prefix matches multiple policy IDs. * `-meta` - Indicates that policy metadata such as the content hash and raft - indices should be show for each entry. + indices should be shown for each entry. * `-name=` - The name of the policy to read.