diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bccdbe672..b53cb18de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 1.0.1 (unreleased) -FEATURES: +IMPROVEMENTS: * cli: Strip iTerm extra characters from password manager input [GH-5837] * ui: Added ability to search for Group and Policy IDs when creating Groups @@ -9,6 +9,7 @@ FEATURES: BUG FIXES: * cli: Show correct stored keys/threshold for autoseals [GH-5910] + * cli: Fix backwards compatibility fallback when listing plugins [GH-5913] * namespaces: Correctly reload the proper mount when tuning or reloading the mount [GH-5937] * secret/pki: Fix panic that could occur during tidy operation when malformed diff --git a/api/sys_plugins.go b/api/sys_plugins.go index b1ffcb24b0..d8881b2f48 100644 --- a/api/sys_plugins.go +++ b/api/sys_plugins.go @@ -49,6 +49,9 @@ func (c *Sys) ListPlugins(i *ListPluginsInput) (*ListPluginsResponse, error) { if err != nil && resp == nil { return nil, err } + if resp == nil { + return nil, nil + } defer resp.Body.Close() // We received an Unsupported Operation response from Vault, indicating diff --git a/command/base_predict.go b/command/base_predict.go index a434b2a22f..51284343cd 100644 --- a/command/base_predict.go +++ b/command/base_predict.go @@ -353,6 +353,9 @@ func (p *Predict) plugins(pluginTypes ...consts.PluginType) []string { if err != nil { return nil } + if result == nil { + return nil + } for _, names := range result.PluginsByType { for _, name := range names { if _, ok := pluginsAdded[name]; !ok { diff --git a/command/plugin_list.go b/command/plugin_list.go index e6f34b80ba..8ed9da9b90 100644 --- a/command/plugin_list.go +++ b/command/plugin_list.go @@ -96,6 +96,10 @@ func (c *PluginListCommand) Run(args []string) int { c.UI.Error(fmt.Sprintf("Error listing available plugins: %s", err)) return 2 } + if resp == nil { + c.UI.Error("No response from server when listing plugins") + return 2 + } switch Format(c.UI) { case "table":