acl: token global mode can not be changed (#20464)

true up CLI and docs with API reality
This commit is contained in:
Daniel Bennett
2024-04-22 11:58:47 -05:00
committed by GitHub
parent ea5f2f6748
commit 3ac3bc1cfe
4 changed files with 4 additions and 18 deletions

View File

@@ -32,9 +32,6 @@ Update Options:
-type="client"
Sets the type of token. Must be one of "client" or "management".
-global=false
Toggles the global mode of the token. Global tokens are replicated to all regions.
-policy=""
Specifies a policy to associate with the token. Can be specified multiple times,
but only with client type tokens.
@@ -48,7 +45,6 @@ func (c *ACLTokenUpdateCommand) AutocompleteFlags() complete.Flags {
complete.Flags{
"name": complete.PredictAnything,
"type": complete.PredictAnything,
"global": complete.PredictNothing,
"policy": complete.PredictAnything,
})
}
@@ -65,13 +61,11 @@ func (*ACLTokenUpdateCommand) Name() string { return "acl token update" }
func (c *ACLTokenUpdateCommand) Run(args []string) int {
var name, tokenType string
var global bool
var policies []string
flags := c.Meta.FlagSet(c.Name(), FlagSetClient)
flags.Usage = func() { c.Ui.Output(c.Help()) }
flags.StringVar(&name, "name", "", "")
flags.StringVar(&tokenType, "type", "", "")
flags.BoolVar(&global, "global", false, "")
flags.Var((funcVar)(func(s string) error {
policies = append(policies, s)
return nil
@@ -113,11 +107,6 @@ func (c *ACLTokenUpdateCommand) Run(args []string) int {
token.Type = tokenType
}
// This will default to false if the user does not specify it
if global != token.Global {
token.Global = global
}
if len(policies) != 0 {
token.Policies = policies
}