fix comment typos (#4890)

This commit is contained in:
R.B. Boyer 2018-11-02 12:00:39 -05:00 committed by GitHub
parent d1b3a63b2f
commit a5d57f5326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 38 additions and 37 deletions

View File

@ -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"

View File

@ -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{

View File

@ -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
//

View File

@ -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
}

View File

@ -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
}

View File

@ -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 = "/"
)

View File

@ -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.

View File

@ -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 <subcommand> [options] [args]
@ -41,10 +41,10 @@ Usage: consul acl <subcommand> [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:

View File

@ -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"
`

View File

@ -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())

View File

@ -33,10 +33,10 @@ Usage: consul acl policy <subcommand> [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 <subcommand> [options] [args]
Update a policy:
$ consul acl policy update other-policy -datacenter dc1
$ consul acl policy update "other-policy" -datacenter "dc1"
Read a policy:

View File

@ -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")

View File

@ -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")

View File

@ -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=<string>` - 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=<string>` - 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=<string>` - The policies name.

View File

@ -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=<string>` - The name of the policy to read.