From c9c80b5ef678f61997f70c42a08ea3077ce2958b Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" <4903+rboyer@users.noreply.github.com> Date: Wed, 21 Jul 2021 14:45:24 -0500 Subject: [PATCH] add partition cli flag to all cli commands that have namespace flag (#10668) --- command/acl/authmethod/create/authmethod_create.go | 2 +- command/acl/authmethod/delete/authmethod_delete.go | 8 +++++--- command/acl/authmethod/list/authmethod_list.go | 8 +++++--- command/acl/authmethod/read/authmethod_read.go | 8 +++++--- command/acl/authmethod/update/authmethod_update.go | 8 +++++--- command/acl/bindingrule/create/bindingrule_create.go | 2 +- command/acl/bindingrule/delete/bindingrule_delete.go | 8 +++++--- command/acl/bindingrule/list/bindingrule_list.go | 8 +++++--- command/acl/bindingrule/read/bindingrule_read.go | 8 +++++--- command/acl/bindingrule/update/bindingrule_update.go | 8 +++++--- command/acl/policy/create/policy_create.go | 8 +++++--- command/acl/policy/delete/policy_delete.go | 8 +++++--- command/acl/policy/list/policy_list.go | 8 +++++--- command/acl/policy/read/policy_read.go | 8 +++++--- command/acl/policy/update/policy_update.go | 8 +++++--- command/acl/role/create/role_create.go | 2 +- command/acl/role/delete/role_delete.go | 8 +++++--- command/acl/role/list/role_list.go | 8 +++++--- command/acl/role/read/role_read.go | 8 +++++--- command/acl/role/update/role_update.go | 8 +++++--- command/acl/token/clone/token_clone.go | 8 +++++--- command/acl/token/create/token_create.go | 8 +++++--- command/acl/token/delete/token_delete.go | 8 +++++--- command/acl/token/list/token_list.go | 8 +++++--- command/acl/token/read/token_read.go | 8 +++++--- command/acl/token/update/token_update.go | 8 +++++--- .../catalog/list/services/catalog_list_services.go | 8 +++++--- command/config/delete/config_delete.go | 8 +++++--- command/config/list/config_list.go | 8 +++++--- command/config/read/config_read.go | 8 +++++--- command/config/write/config_write.go | 8 +++++--- command/connect/envoy/envoy.go | 8 +++++--- command/connect/redirecttraffic/redirect_traffic.go | 8 +++++--- command/flags/http.go | 9 +++++++-- command/intention/check/check.go | 8 +++++--- command/intention/create/create.go | 8 +++++--- command/intention/delete/delete.go | 8 +++++--- command/intention/get/get.go | 8 +++++--- command/intention/list/intention_list.go | 8 +++++--- command/intention/match/match.go | 8 +++++--- command/kv/del/kv_delete.go | 8 +++++--- command/kv/exp/kv_export.go | 8 +++++--- command/kv/get/kv_get.go | 8 +++++--- command/kv/imp/kv_import.go | 8 +++++--- command/kv/put/kv_put.go | 8 +++++--- command/login/login.go | 4 ++-- command/services/deregister/deregister.go | 11 +++++++---- command/services/register/register.go | 8 +++++--- 48 files changed, 229 insertions(+), 137 deletions(-) diff --git a/command/acl/authmethod/create/authmethod_create.go b/command/acl/authmethod/create/authmethod_create.go index 4d4882c06..99e682635 100644 --- a/command/acl/authmethod/create/authmethod_create.go +++ b/command/acl/authmethod/create/authmethod_create.go @@ -139,7 +139,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } diff --git a/command/acl/authmethod/delete/authmethod_delete.go b/command/acl/authmethod/delete/authmethod_delete.go index 82b42fd39..afc9b249d 100644 --- a/command/acl/authmethod/delete/authmethod_delete.go +++ b/command/acl/authmethod/delete/authmethod_delete.go @@ -36,7 +36,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -73,11 +73,13 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Delete an ACL auth method" -const help = ` +const ( + synopsis = "Delete an ACL auth method" + help = ` Usage: consul acl auth-method delete -name NAME [options] Delete an auth method: $ consul acl auth-method delete -name "my-auth-method" ` +) diff --git a/command/acl/authmethod/list/authmethod_list.go b/command/acl/authmethod/list/authmethod_list.go index 25b047826..3c32db04f 100644 --- a/command/acl/authmethod/list/authmethod_list.go +++ b/command/acl/authmethod/list/authmethod_list.go @@ -46,7 +46,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -93,11 +93,13 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Lists ACL auth methods" -const help = ` +const ( + synopsis = "Lists ACL auth methods" + help = ` Usage: consul acl auth-method list [options] List all auth methods: $ consul acl auth-method list ` +) diff --git a/command/acl/authmethod/read/authmethod_read.go b/command/acl/authmethod/read/authmethod_read.go index 19acdcd41..0e1fbc11c 100644 --- a/command/acl/authmethod/read/authmethod_read.go +++ b/command/acl/authmethod/read/authmethod_read.go @@ -56,7 +56,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -111,11 +111,13 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read an ACL auth method" -const help = ` +const ( + synopsis = "Read an ACL auth method" + help = ` Usage: consul acl auth-method read -name NAME [options] Read an auth method: $ consul acl auth-method read -name my-auth-method ` +) diff --git a/command/acl/authmethod/update/authmethod_update.go b/command/acl/authmethod/update/authmethod_update.go index 3125ad7b7..e452f84fa 100644 --- a/command/acl/authmethod/update/authmethod_update.go +++ b/command/acl/authmethod/update/authmethod_update.go @@ -143,7 +143,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -320,8 +320,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Update an ACL auth method" -const help = ` +const ( + synopsis = "Update an ACL auth method" + help = ` Usage: consul acl auth-method update -name NAME [options] Updates an auth method. By default it will merge the auth method @@ -336,3 +337,4 @@ Usage: consul acl auth-method update -name NAME [options] -kubernetes-ca-cert @/path/to/new-kube.ca.crt \ -kubernetes-service-account-jwt "NEW_JWT_CONTENTS" ` +) diff --git a/command/acl/bindingrule/create/bindingrule_create.go b/command/acl/bindingrule/create/bindingrule_create.go index 1059e0de4..df94d6d5b 100644 --- a/command/acl/bindingrule/create/bindingrule_create.go +++ b/command/acl/bindingrule/create/bindingrule_create.go @@ -87,7 +87,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } diff --git a/command/acl/bindingrule/delete/bindingrule_delete.go b/command/acl/bindingrule/delete/bindingrule_delete.go index 635bee0a1..49dac4e59 100644 --- a/command/acl/bindingrule/delete/bindingrule_delete.go +++ b/command/acl/bindingrule/delete/bindingrule_delete.go @@ -39,7 +39,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -82,8 +82,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Delete an ACL binding rule" -const help = ` +const ( + synopsis = "Delete an ACL binding rule" + help = ` Usage: consul acl binding-rule delete -id ID [options] Deletes an ACL binding rule by providing the ID or a unique ID prefix. @@ -96,3 +97,4 @@ Usage: consul acl binding-rule delete -id ID [options] $ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba ` +) diff --git a/command/acl/bindingrule/list/bindingrule_list.go b/command/acl/bindingrule/list/bindingrule_list.go index 34785a43a..997c14d27 100644 --- a/command/acl/bindingrule/list/bindingrule_list.go +++ b/command/acl/bindingrule/list/bindingrule_list.go @@ -56,7 +56,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -103,8 +103,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Lists ACL binding rules" -const help = ` +const ( + synopsis = "Lists ACL binding rules" + help = ` Usage: consul acl binding-rule list [options] Lists all the ACL binding rules. @@ -117,3 +118,4 @@ Usage: consul acl binding-rule list [options] $ consul acl binding-rule list -method="my-method" ` +) diff --git a/command/acl/bindingrule/read/bindingrule_read.go b/command/acl/bindingrule/read/bindingrule_read.go index 5f3f7eeae..cb31664da 100644 --- a/command/acl/bindingrule/read/bindingrule_read.go +++ b/command/acl/bindingrule/read/bindingrule_read.go @@ -58,7 +58,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -119,8 +119,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read an ACL binding rule" -const help = ` +const ( + synopsis = "Read an ACL binding rule" + help = ` Usage: consul acl binding-rule read -id ID [options] This command will retrieve and print out the details of a single binding @@ -130,3 +131,4 @@ Usage: consul acl binding-rule read -id ID [options] $ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba ` +) diff --git a/command/acl/bindingrule/update/bindingrule_update.go b/command/acl/bindingrule/update/bindingrule_update.go index 3acaa7df3..d3d0eb462 100644 --- a/command/acl/bindingrule/update/bindingrule_update.go +++ b/command/acl/bindingrule/update/bindingrule_update.go @@ -101,7 +101,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -217,8 +217,9 @@ func isFlagSet(flags *flag.FlagSet, name string) bool { return found } -const synopsis = "Update an ACL binding rule" -const help = ` +const ( + synopsis = "Update an ACL binding rule" + help = ` Usage: consul acl binding-rule update -id ID [options] Updates a binding rule. By default it will merge the binding rule @@ -234,3 +235,4 @@ Usage: consul acl binding-rule update -id ID [options] -bind-name='k8s-${serviceaccount.name}' \ -selector='serviceaccount.namespace==default and serviceaccount.name==web' ` +) diff --git a/command/acl/policy/create/policy_create.go b/command/acl/policy/create/policy_create.go index e09cad062..00546ff18 100644 --- a/command/acl/policy/create/policy_create.go +++ b/command/acl/policy/create/policy_create.go @@ -66,7 +66,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -154,8 +154,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Create an ACL policy" -const help = ` +const ( + synopsis = "Create an ACL policy" + help = ` Usage: consul acl policy create -name NAME [options] Both the -rules and -from-token option values allow loading the value @@ -177,3 +178,4 @@ Usage: consul acl policy create -name NAME [options] -description "Token Converted to policy" \ -from-token "c1e34113-e7ab-4451-b1a6-336ddcc58fc6" ` +) diff --git a/command/acl/policy/delete/policy_delete.go b/command/acl/policy/delete/policy_delete.go index fd4c848e7..109cdb9ac 100644 --- a/command/acl/policy/delete/policy_delete.go +++ b/command/acl/policy/delete/policy_delete.go @@ -34,7 +34,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -82,8 +82,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Delete an ACL policy" -const help = ` +const ( + synopsis = "Delete an ACL policy" + help = ` Usage: consul acl policy delete [options] -id POLICY Deletes an ACL policy by providing either the ID or a unique ID prefix. @@ -97,3 +98,4 @@ Usage: consul acl policy delete [options] -id POLICY $ consul acl policy delete -id b6b856da-5193-4e78-845a-7d61ca8371ba ` +) diff --git a/command/acl/policy/list/policy_list.go b/command/acl/policy/list/policy_list.go index 3d1e81934..8b788f30b 100644 --- a/command/acl/policy/list/policy_list.go +++ b/command/acl/policy/list/policy_list.go @@ -40,7 +40,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -86,8 +86,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Lists ACL policies" -const help = ` +const ( + synopsis = "Lists ACL policies" + help = ` Usage: consul acl policy list [options] Lists all the ACL policies @@ -96,3 +97,4 @@ Usage: consul acl policy list [options] $ consul acl policy list ` +) diff --git a/command/acl/policy/read/policy_read.go b/command/acl/policy/read/policy_read.go index 703443bf7..3d043815f 100644 --- a/command/acl/policy/read/policy_read.go +++ b/command/acl/policy/read/policy_read.go @@ -46,7 +46,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -108,8 +108,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read an ACL policy" -const help = ` +const ( + synopsis = "Read an ACL policy" + help = ` Usage: consul acl policy read [options] POLICY This command will retrieve and print out the details @@ -124,3 +125,4 @@ Usage: consul acl policy read [options] POLICY $ consul acl policy read -name my-policy ` +) diff --git a/command/acl/policy/update/policy_update.go b/command/acl/policy/update/policy_update.go index 2e2623f31..4af67cfe2 100644 --- a/command/acl/policy/update/policy_update.go +++ b/command/acl/policy/update/policy_update.go @@ -67,7 +67,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -185,8 +185,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Update an ACL policy" -const help = ` +const ( + synopsis = "Update an ACL policy" + help = ` Usage: consul acl policy update [options] Updates a policy. By default it will merge the policy information with its @@ -203,3 +204,4 @@ Usage: consul acl policy update [options] # the description $consul acl policy update -id abcd -name "better-name" -rules @rules.hcl ` +) diff --git a/command/acl/role/create/role_create.go b/command/acl/role/create/role_create.go index c86848986..c4f480464 100644 --- a/command/acl/role/create/role_create.go +++ b/command/acl/role/create/role_create.go @@ -60,7 +60,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } diff --git a/command/acl/role/delete/role_delete.go b/command/acl/role/delete/role_delete.go index e4b0086a9..d43858379 100644 --- a/command/acl/role/delete/role_delete.go +++ b/command/acl/role/delete/role_delete.go @@ -34,7 +34,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -82,8 +82,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Delete an ACL role" -const help = ` +const ( + synopsis = "Delete an ACL role" + help = ` Usage: consul acl role delete [options] -id ROLE Deletes an ACL role by providing the ID or a unique ID prefix. @@ -97,3 +98,4 @@ Usage: consul acl role delete [options] -id ROLE $ consul acl role delete -id b6b856da-5193-4e78-845a-7d61ca8371ba ` +) diff --git a/command/acl/role/list/role_list.go b/command/acl/role/list/role_list.go index 9fc1bd124..8d69fc96a 100644 --- a/command/acl/role/list/role_list.go +++ b/command/acl/role/list/role_list.go @@ -40,7 +40,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -86,8 +86,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Lists ACL roles" -const help = ` +const ( + synopsis = "Lists ACL roles" + help = ` Usage: consul acl role list [options] Lists all the ACL roles. @@ -96,3 +97,4 @@ Usage: consul acl role list [options] $ consul acl role list ` +) diff --git a/command/acl/role/read/role_read.go b/command/acl/role/read/role_read.go index 8b77717d7..5d46dbad2 100644 --- a/command/acl/role/read/role_read.go +++ b/command/acl/role/read/role_read.go @@ -47,7 +47,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -120,8 +120,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read an ACL role" -const help = ` +const ( + synopsis = "Read an ACL role" + help = ` Usage: consul acl role read [options] ROLE This command will retrieve and print out the details @@ -136,3 +137,4 @@ Usage: consul acl role read [options] ROLE $ consul acl role read -name my-policy ` +) diff --git a/command/acl/role/update/role_update.go b/command/acl/role/update/role_update.go index afbadeb20..c9b116a30 100644 --- a/command/acl/role/update/role_update.go +++ b/command/acl/role/update/role_update.go @@ -69,7 +69,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -250,8 +250,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Update an ACL role" -const help = ` +const ( + synopsis = "Update an ACL role" + help = ` Usage: consul acl role update [options] Updates a role. By default it will merge the role information with its @@ -270,3 +271,4 @@ Usage: consul acl role update [options] -policy-name "token-replication" \ -service-identity "web" ` +) diff --git a/command/acl/token/clone/token_clone.go b/command/acl/token/clone/token_clone.go index f08644f77..129a451cf 100644 --- a/command/acl/token/clone/token_clone.go +++ b/command/acl/token/clone/token_clone.go @@ -44,7 +44,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -101,8 +101,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Clone an ACL token" -const help = ` +const ( + synopsis = "Clone an ACL token" + help = ` Usage: consul acl token clone [options] This command will clone a token. When cloning an alternate description may be given @@ -112,3 +113,4 @@ Usage: consul acl token clone [options] $ consul acl token clone -id abcd -description "replication" ` +) diff --git a/command/acl/token/create/token_create.go b/command/acl/token/create/token_create.go index 14bac71af..15ac10cb9 100644 --- a/command/acl/token/create/token_create.go +++ b/command/acl/token/create/token_create.go @@ -75,7 +75,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -182,8 +182,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Create an ACL token" -const help = ` +const ( + synopsis = "Create an ACL token" + help = ` Usage: consul acl token create [options] When creating a new token policies may be linked using either the -policy-id @@ -200,3 +201,4 @@ Usage: consul acl token create [options] -service-identity "web" \ -service-identity "db:east,west" ` +) diff --git a/command/acl/token/delete/token_delete.go b/command/acl/token/delete/token_delete.go index fe93d2e6b..94af0c1bc 100644 --- a/command/acl/token/delete/token_delete.go +++ b/command/acl/token/delete/token_delete.go @@ -33,7 +33,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -76,8 +76,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Delete an ACL token" -const help = ` +const ( + synopsis = "Delete an ACL token" + help = ` Usage: consul acl token delete [options] -id TOKEN Deletes an ACL token by providing either the ID or a unique ID prefix. @@ -90,3 +91,4 @@ Usage: consul acl token delete [options] -id TOKEN $ consul acl token delete -id b6b856da-5193-4e78-845a-7d61ca8371ba ` +) diff --git a/command/acl/token/list/token_list.go b/command/acl/token/list/token_list.go index c89340db6..28c96122a 100644 --- a/command/acl/token/list/token_list.go +++ b/command/acl/token/list/token_list.go @@ -39,7 +39,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -85,11 +85,13 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "List ACL tokens" -const help = ` +const ( + synopsis = "List ACL tokens" + help = ` Usage: consul acl token list [options] List all the ACL tokens $ consul acl token list ` +) diff --git a/command/acl/token/read/token_read.go b/command/acl/token/read/token_read.go index 377d0a3b9..8b0616cdc 100644 --- a/command/acl/token/read/token_read.go +++ b/command/acl/token/read/token_read.go @@ -48,7 +48,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -114,8 +114,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read an ACL token" -const help = ` +const ( + synopsis = "Read an ACL token" + help = ` Usage: consul acl token read [options] -id TOKENID This command will retrieve and print out the details of @@ -129,3 +130,4 @@ Usage: consul acl token read [options] -id TOKENID $ consul acl token read -id 4be56c77-8244-4c7d-b08c-667b8c71baed ` +) diff --git a/command/acl/token/update/token_update.go b/command/acl/token/update/token_update.go index 2a5592ab3..4a8b97b4b 100644 --- a/command/acl/token/update/token_update.go +++ b/command/acl/token/update/token_update.go @@ -86,7 +86,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -331,8 +331,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Update an ACL token" -const help = ` +const ( + synopsis = "Update an ACL token" + help = ` Usage: consul acl token update [options] This command will update a token. Some parts such as marking the token local @@ -349,3 +350,4 @@ Usage: consul acl token update [options] -policy-name "token-replication" \ -role-name "db-updater" ` +) diff --git a/command/catalog/list/services/catalog_list_services.go b/command/catalog/list/services/catalog_list_services.go index a3dd73805..95359286b 100644 --- a/command/catalog/list/services/catalog_list_services.go +++ b/command/catalog/list/services/catalog_list_services.go @@ -46,7 +46,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -134,8 +134,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Lists all registered services in a datacenter" -const help = ` +const ( + synopsis = "Lists all registered services in a datacenter" + help = ` Usage: consul catalog services [options] Retrieves the list services registered in a given datacenter. By default, the @@ -159,3 +160,4 @@ Usage: consul catalog services [options] For a full list of options and examples, please see the Consul documentation. ` +) diff --git a/command/config/delete/config_delete.go b/command/config/delete/config_delete.go index 41eef8b15..456b06825 100644 --- a/command/config/delete/config_delete.go +++ b/command/config/delete/config_delete.go @@ -31,7 +31,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -74,8 +74,9 @@ func (c *cmd) Help() string { return flags.Usage(help, nil) } -const synopsis = "Delete a centralized config entry" -const help = ` +const ( + synopsis = "Delete a centralized config entry" + help = ` Usage: consul config delete [options] -kind -name Deletes the configuration entry specified by the kind and name. @@ -84,3 +85,4 @@ Usage: consul config delete [options] -kind -name $ consul config delete -kind service-defaults -name web ` +) diff --git a/command/config/list/config_list.go b/command/config/list/config_list.go index 3a6d77c54..3df95e3ce 100644 --- a/command/config/list/config_list.go +++ b/command/config/list/config_list.go @@ -29,7 +29,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -69,8 +69,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "List centralized config entries of a given kind" -const help = ` +const ( + synopsis = "List centralized config entries of a given kind" + help = ` Usage: consul config list [options] -kind Lists all of the config entries for a given kind. The -kind parameter @@ -81,3 +82,4 @@ Usage: consul config list [options] -kind $ consul config list -kind service-defaults ` +) diff --git a/command/config/read/config_read.go b/command/config/read/config_read.go index 399e68c28..afd30843a 100644 --- a/command/config/read/config_read.go +++ b/command/config/read/config_read.go @@ -34,7 +34,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -83,8 +83,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Read a centralized config entry" -const help = ` +const ( + synopsis = "Read a centralized config entry" + help = ` Usage: consul config read [options] -kind -name Reads the config entry specified by the given kind and name and outputs its @@ -94,3 +95,4 @@ Usage: consul config read [options] -kind -name $ consul config read -kind proxy-defaults -name global ` +) diff --git a/command/config/write/config_write.go b/command/config/write/config_write.go index c7b3a72fd..9e08fde38 100644 --- a/command/config/write/config_write.go +++ b/command/config/write/config_write.go @@ -45,7 +45,7 @@ func (c *cmd) init() { "This is used in combination with the -cas flag.") flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -179,8 +179,9 @@ func (c *cmd) Help() string { return flags.Usage(c.help, nil) } -const synopsis = "Create or update a centralized config entry" -const help = ` +const ( + synopsis = "Create or update a centralized config entry" + help = ` Usage: consul config write [options] Request a config entry to be created or updated. The configuration @@ -196,3 +197,4 @@ Usage: consul config write [options] $ consul config write - ` +) diff --git a/command/connect/envoy/envoy.go b/command/connect/envoy/envoy.go index a94a61d97..a4bca3a9a 100644 --- a/command/connect/envoy/envoy.go +++ b/command/connect/envoy/envoy.go @@ -168,7 +168,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -660,8 +660,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Runs or Configures Envoy as a Connect proxy" -const help = ` +const ( + synopsis = "Runs or Configures Envoy as a Connect proxy" + help = ` Usage: consul connect envoy [options] [-- pass-through options] Generates the bootstrap configuration needed to start an Envoy proxy instance @@ -689,3 +690,4 @@ Usage: consul connect envoy [options] [-- pass-through options] $ consul connect envoy -sidecar-for web -- --log-level debug ` +) diff --git a/command/connect/redirecttraffic/redirect_traffic.go b/command/connect/redirecttraffic/redirect_traffic.go index a6084ea19..8d79e7599 100644 --- a/command/connect/redirecttraffic/redirect_traffic.go +++ b/command/connect/redirecttraffic/redirect_traffic.go @@ -68,7 +68,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -237,8 +237,9 @@ func (c *cmd) generateConfigFromFlags() (iptables.Config, error) { return cfg, nil } -const synopsis = "Applies iptables rules for traffic redirection" -const help = ` +const ( + synopsis = "Applies iptables rules for traffic redirection" + help = ` Usage: consul connect redirect-traffic [options] Applies iptables rules for inbound and outbound traffic redirection. @@ -251,3 +252,4 @@ Usage: consul connect redirect-traffic [options] $ consul connect redirect-traffic -proxy-uid 1234 -proxy-inbound-port 20000 ` +) diff --git a/command/flags/http.go b/command/flags/http.go index 732852642..5d003d94c 100644 --- a/command/flags/http.go +++ b/command/flags/http.go @@ -23,8 +23,9 @@ type HTTPFlags struct { datacenter StringValue stale BoolValue - // namespace flags + // multi-tenancy flags namespace StringValue + partition StringValue } func (f *HTTPFlags) ClientFlags() *flag.FlagSet { @@ -74,12 +75,16 @@ func (f *HTTPFlags) ServerFlags() *flag.FlagSet { return fs } -func (f *HTTPFlags) NamespaceFlags() *flag.FlagSet { +func (f *HTTPFlags) MultiTenancyFlags() *flag.FlagSet { fs := flag.NewFlagSet("", flag.ContinueOnError) fs.Var(&f.namespace, "namespace", "Specifies the namespace to query. If not provided, the namespace will be inferred "+ "from the request's ACL token, or will default to the `default` namespace. "+ "Namespaces are a Consul Enterprise feature.") + fs.Var(&f.partition, "partition", + "Specifies the admin partition to query. If not provided, the admin partition will be inferred "+ + "from the request's ACL token, or will default to the `default` admin partition. "+ + "Admin Partitions are a Consul Enterprise feature.") return fs } diff --git a/command/intention/check/check.go b/command/intention/check/check.go index 8de0f263f..18e4df76f 100644 --- a/command/intention/check/check.go +++ b/command/intention/check/check.go @@ -31,7 +31,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -81,8 +81,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Check whether a connection between two services is allowed." -const help = ` +const ( + synopsis = "Check whether a connection between two services is allowed." + help = ` Usage: consul intention check [options] SRC DST Check whether a connection between SRC and DST would be allowed by @@ -91,3 +92,4 @@ Usage: consul intention check [options] SRC DST $ consul intention check web db ` +) diff --git a/command/intention/create/create.go b/command/intention/create/create.go index 37faeae44..2ecd9e60d 100644 --- a/command/intention/create/create.go +++ b/command/intention/create/create.go @@ -53,7 +53,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -224,8 +224,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Create intentions for service connections." -const help = ` +const ( + synopsis = "Create intentions for service connections." + help = ` Usage: consul intention create [options] SRC DST Usage: consul intention create [options] -file FILE... @@ -254,3 +255,4 @@ Usage: consul intention create [options] -file FILE... Additional flags and more advanced use cases are detailed below. ` +) diff --git a/command/intention/delete/delete.go b/command/intention/delete/delete.go index f64b3a3f6..3f5a3d394 100644 --- a/command/intention/delete/delete.go +++ b/command/intention/delete/delete.go @@ -30,7 +30,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -80,8 +80,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Delete an intention." -const help = ` +const ( + synopsis = "Delete an intention." + help = ` Usage: consul intention delete [options] SRC DST Usage: consul intention delete [options] ID @@ -91,3 +92,4 @@ Usage: consul intention delete [options] ID $ consul intention delete web db ` +) diff --git a/command/intention/get/get.go b/command/intention/get/get.go index dbf693713..567268482 100644 --- a/command/intention/get/get.go +++ b/command/intention/get/get.go @@ -35,7 +35,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -106,8 +106,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Show information about an intention." -const help = ` +const ( + synopsis = "Show information about an intention." + help = ` Usage: consul intention get [options] SRC DST Usage: consul intention get [options] ID @@ -117,3 +118,4 @@ Usage: consul intention get [options] ID $ consul intention get web db ` +) diff --git a/command/intention/list/intention_list.go b/command/intention/list/intention_list.go index 929c99cb0..fc0e0f98d 100644 --- a/command/intention/list/intention_list.go +++ b/command/intention/list/intention_list.go @@ -28,7 +28,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -77,9 +77,11 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "List intentions." -const help = ` +const ( + synopsis = "List intentions." + help = ` Usage: consul intention list List all intentions. ` +) diff --git a/command/intention/match/match.go b/command/intention/match/match.go index c05e82bf1..8678d708a 100644 --- a/command/intention/match/match.go +++ b/command/intention/match/match.go @@ -40,7 +40,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -97,8 +97,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Show intentions that match a source or destination." -const help = ` +const ( + synopsis = "Show intentions that match a source or destination." + help = ` Usage: consul intention match [options] SRC|DST Show the list of intentions that would be enforced for a given source @@ -109,3 +110,4 @@ Usage: consul intention match [options] SRC|DST $ consul intention match -source web ` +) diff --git a/command/kv/del/kv_delete.go b/command/kv/del/kv_delete.go index 62fe49f7c..f46691045 100644 --- a/command/kv/del/kv_delete.go +++ b/command/kv/del/kv_delete.go @@ -39,7 +39,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -147,8 +147,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Removes data from the KV store" -const help = ` +const ( + synopsis = "Removes data from the KV store" + help = ` Usage: consul kv delete [options] KEY_OR_PREFIX Removes the value from Consul's key-value store at the given path. If no @@ -165,3 +166,4 @@ Usage: consul kv delete [options] KEY_OR_PREFIX This will delete the keys named "foo", "food", and "foo/bar/zip" if they existed. ` +) diff --git a/command/kv/exp/kv_export.go b/command/kv/exp/kv_export.go index 9fbb2838c..84f87f637 100644 --- a/command/kv/exp/kv_export.go +++ b/command/kv/exp/kv_export.go @@ -29,7 +29,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -97,8 +97,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Exports a tree from the KV store as JSON" -const help = ` +const ( + synopsis = "Exports a tree from the KV store as JSON" + help = ` Usage: consul kv export [KEY_OR_PREFIX] Retrieves key-value pairs for the given prefix from Consul's key-value store, @@ -109,3 +110,4 @@ Usage: consul kv export [KEY_OR_PREFIX] For a full list of options and examples, please see the Consul documentation. ` +) diff --git a/command/kv/get/kv_get.go b/command/kv/get/kv_get.go index f8c3838eb..136202b6c 100644 --- a/command/kv/get/kv_get.go +++ b/command/kv/get/kv_get.go @@ -54,7 +54,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -210,8 +210,9 @@ func prettyKVPair(w io.Writer, pair *api.KVPair, base64EncodeValue bool) error { return tw.Flush() } -const synopsis = "Retrieves or lists data from the KV store" -const help = ` +const ( + synopsis = "Retrieves or lists data from the KV store" + help = ` Usage: consul kv get [options] [KEY_OR_PREFIX] Retrieves the value from Consul's key-value store at the given key name. If no @@ -242,3 +243,4 @@ Usage: consul kv get [options] [KEY_OR_PREFIX] For a full list of options and examples, please see the Consul documentation. ` +) diff --git a/command/kv/imp/kv_import.go b/command/kv/imp/kv_import.go index bae2dd2ba..0c46ffd5b 100644 --- a/command/kv/imp/kv_import.go +++ b/command/kv/imp/kv_import.go @@ -41,7 +41,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -145,8 +145,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Imports a tree stored as JSON to the KV store" -const help = ` +const ( + synopsis = "Imports a tree stored as JSON to the KV store" + help = ` Usage: consul kv import [DATA] Imports key-value pairs to the key-value store from the JSON representation @@ -166,3 +167,4 @@ Usage: consul kv import [DATA] For a full list of options and examples, please see the Consul documentation. ` +) diff --git a/command/kv/put/kv_put.go b/command/kv/put/kv_put.go index 55c73439d..57df7c1c9 100644 --- a/command/kv/put/kv_put.go +++ b/command/kv/put/kv_put.go @@ -68,7 +68,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -198,8 +198,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Sets or updates data in the KV store" -const help = ` +const ( + synopsis = "Sets or updates data in the KV store" + help = ` Usage: consul kv put [options] KEY [DATA] Writes the data to the given path in the key-value store. The data can be of @@ -232,3 +233,4 @@ Usage: consul kv put [options] KEY [DATA] Additional flags and more advanced use cases are detailed below. ` +) diff --git a/command/login/login.go b/command/login/login.go index 753ea2b55..ded0958f9 100644 --- a/command/login/login.go +++ b/command/login/login.go @@ -63,7 +63,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -139,7 +139,7 @@ func (c *cmd) bearerTokenLogin() int { func (c *cmd) writeToSink(tok *api.ACLToken) error { payload := []byte(tok.SecretID) - return file.WriteAtomicWithPerms(c.tokenSinkFile, payload, 0755, 0600) + return file.WriteAtomicWithPerms(c.tokenSinkFile, payload, 0o755, 0o600) } func (c *cmd) Synopsis() string { diff --git a/command/services/deregister/deregister.go b/command/services/deregister/deregister.go index 724a22fed..6c28347c0 100644 --- a/command/services/deregister/deregister.go +++ b/command/services/deregister/deregister.go @@ -32,7 +32,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -52,7 +52,8 @@ func (c *cmd) Run(args []string) int { } svcs := []*api.AgentServiceRegistration{{ - ID: c.flagId}} + ID: c.flagId, + }} if len(args) > 0 { var err error svcs, err = services.ServicesFromFiles(c.UI, args) @@ -99,8 +100,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Deregister services with the local agent" -const help = ` +const ( + synopsis = "Deregister services with the local agent" + help = ` Usage: consul services deregister [options] [FILE...] Deregister one or more services that were previously registered with @@ -115,3 +117,4 @@ Usage: consul services deregister [options] [FILE...] Services are deregistered from the local agent catalog. This command must be run against the same agent where the service was registered. ` +) diff --git a/command/services/register/register.go b/command/services/register/register.go index 5a31f1070..047e09571 100644 --- a/command/services/register/register.go +++ b/command/services/register/register.go @@ -58,7 +58,7 @@ func (c *cmd) init() { c.http = &flags.HTTPFlags{} flags.Merge(c.flags, c.http.ClientFlags()) flags.Merge(c.flags, c.http.ServerFlags()) - flags.Merge(c.flags, c.http.NamespaceFlags()) + flags.Merge(c.flags, c.http.MultiTenancyFlags()) c.help = flags.Usage(help, c.flags) } @@ -139,8 +139,9 @@ func (c *cmd) Help() string { return c.help } -const synopsis = "Register services with the local agent" -const help = ` +const ( + synopsis = "Register services with the local agent" + help = ` Usage: consul services register [options] [FILE...] Register one or more services using the local agent API. Services can @@ -153,3 +154,4 @@ Usage: consul services register [options] [FILE...] Additional flags and more advanced use cases are detailed below. ` +)