cli: Improve error handling for plugin commands (#24250)

* Stop supporting vault plugin info and deregister without a type argument
* Make a best-effort attempt to report whether a plugin was actually deregistered and give more descriptive errors
* Fix error message for vault plugin reload
This commit is contained in:
Tom Proctor
2023-11-28 14:13:26 +00:00
committed by GitHub
parent 030bba4e68
commit 51d99fc7cf
7 changed files with 95 additions and 30 deletions

View File

@@ -46,13 +46,13 @@ func TestPluginReloadCommand_Run(t *testing.T) {
{
"not_enough_args",
nil,
"Not enough arguments",
"No plugins specified, must specify exactly one of -plugin or -mounts",
1,
},
{
"too_many_args",
[]string{"-plugin", "foo", "-mounts", "bar"},
"Too many arguments",
"Must specify exactly one of -plugin or -mounts",
1,
},
}
@@ -147,7 +147,7 @@ func TestPluginReloadStatusCommand_Run(t *testing.T) {
client, closer := testVaultServer(t)
defer closer()
ui, cmd := testPluginReloadCommand(t)
ui, cmd := testPluginReloadStatusCommand(t)
cmd.client = client
args := append([]string{}, tc.args...)