fix comment typos (#4890)
This commit is contained in:
parent
d1b3a63b2f
commit
a5d57f5326
|
@ -176,7 +176,7 @@ func TestAgent_Services_Sidecar(t *testing.T) {
|
||||||
assert.Equal(srv1.Proxy.DestinationServiceName, actual.ProxyDestination)
|
assert.Equal(srv1.Proxy.DestinationServiceName, actual.ProxyDestination)
|
||||||
|
|
||||||
// Sanity check that LocalRegisteredAsSidecar is not in the output (assuming
|
// 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,
|
// 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 incase we change the endpoint to
|
||||||
// return the internal struct later and accidentally expose some "internal"
|
// return the internal struct later and accidentally expose some "internal"
|
||||||
|
|
|
@ -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.
|
// 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
|
// 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
|
// 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()
|
a.removeBootstrapResetFile()
|
||||||
|
|
||||||
accessor, err := lib.GenerateUUID(a.srv.checkTokenUUID)
|
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
|
// 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() {
|
if !a.srv.LocalTokensEnabled() {
|
||||||
args.Datacenter = a.srv.config.ACLDatacenter
|
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
|
// 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() {
|
if !a.srv.LocalTokensEnabled() {
|
||||||
args.Datacenter = a.srv.config.ACLDatacenter
|
args.Datacenter = a.srv.config.ACLDatacenter
|
||||||
}
|
}
|
||||||
|
@ -733,7 +733,7 @@ func (a *ACL) PolicySet(args *structs.ACLPolicySetRequest, reply *structs.ACLPol
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// calcualte the hash for this policy
|
// calculate the hash for this policy
|
||||||
policy.SetHash(true)
|
policy.SetHash(true)
|
||||||
|
|
||||||
req := &structs.ACLPolicyBatchSetRequest{
|
req := &structs.ACLPolicyBatchSetRequest{
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverACLCacheConfig *structs.ACLCachesConfig = &structs.ACLCachesConfig{
|
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
|
// 1 - All policies can be resolved locally. Hence we do not cache any
|
||||||
// unparsed policies as we have memdb for that.
|
// 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
|
// number of distinct policies and combined multi-policy authorizers
|
||||||
// will be much less.
|
// will be much less.
|
||||||
// 3 - If you need more than 10k tokens cached then you should probably
|
// 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
|
// cases resolving the tokens from memdb will avoid the cache
|
||||||
// entirely
|
// entirely
|
||||||
//
|
//
|
||||||
|
|
|
@ -158,7 +158,7 @@ func (c *FSM) applyACLOperation(buf []byte, index uint64) interface{} {
|
||||||
}
|
}
|
||||||
return enabled
|
return enabled
|
||||||
case structs.ACLBootstrapNow:
|
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 {
|
if err := c.state.ACLBootstrap(index, 0, req.ACL.Convert(), true); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,7 +603,7 @@ func (s *Server) startACLUpgrade() {
|
||||||
|
|
||||||
var newTokens structs.ACLTokens
|
var newTokens structs.ACLTokens
|
||||||
for _, token := range tokens {
|
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 != "" {
|
if token.AccessorID != "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// DiskUsagePath is the path to check usage of the disk.
|
// 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 = "/"
|
DiskUsagePath = "/"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ const (
|
||||||
// dont accidentally create them when autogenerating uuids.
|
// dont accidentally create them when autogenerating uuids.
|
||||||
|
|
||||||
// This policy gives unlimited access to everything. Users
|
// 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"
|
ACLPolicyGlobalManagementID = "00000000-0000-0000-0000-000000000001"
|
||||||
ACLPolicyGlobalManagement = `
|
ACLPolicyGlobalManagement = `
|
||||||
acl = "write"
|
acl = "write"
|
||||||
|
@ -82,6 +82,7 @@ session_prefix "" {
|
||||||
}`
|
}`
|
||||||
|
|
||||||
// This is the policy ID for anonymous access. This is configurable by the
|
// This is the policy ID for anonymous access. This is configurable by the
|
||||||
|
// user.
|
||||||
ACLTokenAnonymousID = "00000000-0000-0000-0000-000000000002"
|
ACLTokenAnonymousID = "00000000-0000-0000-0000-000000000002"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -308,7 +309,7 @@ type ACLPolicy struct {
|
||||||
// The rule set (using the updated rule syntax)
|
// The rule set (using the updated rule syntax)
|
||||||
Rules string
|
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:"-"`
|
Syntax acl.SyntaxVersion `json:"-"`
|
||||||
|
|
||||||
// Datacenters that the policy is valid within.
|
// Datacenters that the policy is valid within.
|
||||||
|
|
|
@ -23,7 +23,7 @@ func (c *cmd) Help() string {
|
||||||
return flags.Usage(help, nil)
|
return flags.Usage(help, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
const synopsis = "Interact with the Consul's ACLs"
|
const synopsis = "Interact with Consul's ACLs"
|
||||||
const help = `
|
const help = `
|
||||||
Usage: consul acl <subcommand> [options] [args]
|
Usage: consul acl <subcommand> [options] [args]
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@ Usage: consul acl <subcommand> [options] [args]
|
||||||
|
|
||||||
Create a new ACL Policy:
|
Create a new ACL Policy:
|
||||||
|
|
||||||
$ consul acl policy create “new-policy” \
|
$ consul acl policy create "new-policy" \
|
||||||
-description “This is an example policy” \
|
-description "This is an example policy" \
|
||||||
-datacenter “dc1” \
|
-datacenter "dc1" \
|
||||||
-datacenter “dc2” \
|
-datacenter "dc2" \
|
||||||
-rules @rules.hcl
|
-rules @rules.hcl
|
||||||
|
|
||||||
Set the default agent token:
|
Set the default agent token:
|
||||||
|
|
|
@ -40,7 +40,7 @@ type cmd struct {
|
||||||
func (c *cmd) init() {
|
func (c *cmd) init() {
|
||||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||||
c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+
|
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.name, "name", "", "The new policies name. This flag is required.")
|
||||||
c.flags.StringVar(&c.description, "description", "", "A description of the policy")
|
c.flags.StringVar(&c.description, "description", "", "A description of the policy")
|
||||||
c.flags.Var((*flags.AppendSliceValue)(&c.datacenters), "valid-datacenter", "Datacenter "+
|
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:
|
Create a new policy:
|
||||||
|
|
||||||
$ consul acl policy create -name “new-policy” \
|
$ consul acl policy create -name "new-policy" \
|
||||||
-description “This is an example policy” \
|
-description "This is an example policy" \
|
||||||
-datacenter “dc1” \
|
-datacenter "dc1" \
|
||||||
-datacenter “dc2” \
|
-datacenter "dc2" \
|
||||||
-rules @rules.hcl
|
-rules @rules.hcl
|
||||||
|
|
||||||
Creation a policy from a legacy token:
|
Creation a policy from a legacy token:
|
||||||
|
|
||||||
$ consul acl policy create -name “legacy-policy” \
|
$ consul acl policy create -name "legacy-policy" \
|
||||||
-description “Token Converted to Policy” \
|
-description "Token Converted to Policy" \
|
||||||
-from-token “c1e34113-e7ab-4451-b1a6-336ddcc58fc6”
|
-from-token "c1e34113-e7ab-4451-b1a6-336ddcc58fc6"
|
||||||
`
|
`
|
||||||
|
|
|
@ -27,7 +27,7 @@ type cmd struct {
|
||||||
func (c *cmd) init() {
|
func (c *cmd) init() {
|
||||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||||
c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+
|
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{}
|
c.http = &flags.HTTPFlags{}
|
||||||
flags.Merge(c.flags, c.http.ClientFlags())
|
flags.Merge(c.flags, c.http.ClientFlags())
|
||||||
|
|
|
@ -33,10 +33,10 @@ Usage: consul acl policy <subcommand> [options] [args]
|
||||||
|
|
||||||
Create a new ACL Policy:
|
Create a new ACL Policy:
|
||||||
|
|
||||||
$ consul acl policy create “new-policy” \
|
$ consul acl policy create "new-policy" \
|
||||||
-description “This is an example policy” \
|
-description "This is an example policy" \
|
||||||
-datacenter “dc1” \
|
-datacenter "dc1" \
|
||||||
-datacenter “dc2” \
|
-datacenter "dc2" \
|
||||||
-rules @rules.hcl
|
-rules @rules.hcl
|
||||||
List all policies:
|
List all policies:
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ Usage: consul acl policy <subcommand> [options] [args]
|
||||||
|
|
||||||
Update a policy:
|
Update a policy:
|
||||||
|
|
||||||
$ consul acl policy update “other-policy” -datacenter “dc1”
|
$ consul acl policy update "other-policy" -datacenter "dc1"
|
||||||
|
|
||||||
Read a policy:
|
Read a policy:
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ type cmd struct {
|
||||||
func (c *cmd) init() {
|
func (c *cmd) init() {
|
||||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||||
c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+
|
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. "+
|
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 "+
|
"It may be specified as a unique ID prefix but will error if the prefix "+
|
||||||
"matches multiple policy IDs")
|
"matches multiple policy IDs")
|
||||||
|
|
|
@ -40,7 +40,7 @@ type cmd struct {
|
||||||
func (c *cmd) init() {
|
func (c *cmd) init() {
|
||||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||||
c.flags.BoolVar(&c.showMeta, "meta", false, "Indicates that policy metadata such "+
|
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. "+
|
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 "+
|
"It may be specified as a unique ID prefix but will error if the prefix "+
|
||||||
"matches multiple policy IDs")
|
"matches multiple policy IDs")
|
||||||
|
|
|
@ -80,7 +80,7 @@ Usage: `consul acl policy create [options] [args]`
|
||||||
stdin or from a file.
|
stdin or from a file.
|
||||||
|
|
||||||
* `-meta` - Indicates that policy metadata such as the content hash and raft
|
* `-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.
|
* `-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.
|
prefix but will error if the prefix matches multiple policy IDs.
|
||||||
|
|
||||||
* `-meta` - Indicates that policy metadata such as the content hash and raft
|
* `-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.
|
* `-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
|
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
|
* `-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.
|
* `-name=<string>` - The policies name.
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ Usage: `consul acl token read [options] [args]`
|
||||||
prefix but will error if the prefix matches multiple policy IDs.
|
prefix but will error if the prefix matches multiple policy IDs.
|
||||||
|
|
||||||
* `-meta` - Indicates that policy metadata such as the content hash and raft
|
* `-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.
|
* `-name=<string>` - The name of the policy to read.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue