mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Make API not depend on SDK (#18962)
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/vault/api"
|
||||
"github.com/hashicorp/vault/sdk/helper/consts"
|
||||
"github.com/mitchellh/cli"
|
||||
"github.com/posener/complete"
|
||||
)
|
||||
@@ -90,12 +89,12 @@ func (c *PluginListCommand) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
pluginType := consts.PluginTypeUnknown
|
||||
pluginType := api.PluginTypeUnknown
|
||||
if len(args) > 0 {
|
||||
pluginTypeStr := strings.TrimSpace(args[0])
|
||||
if pluginTypeStr != "" {
|
||||
var err error
|
||||
pluginType, err = consts.ParsePluginType(pluginTypeStr)
|
||||
pluginType, err = api.ParsePluginType(pluginTypeStr)
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Sprintf("Error parsing type: %s", err))
|
||||
return 2
|
||||
@@ -139,10 +138,10 @@ func (c *PluginListCommand) Run(args []string) int {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *PluginListCommand) simpleResponse(plugins *api.ListPluginsResponse, pluginType consts.PluginType) []string {
|
||||
func (c *PluginListCommand) simpleResponse(plugins *api.ListPluginsResponse, pluginType api.PluginType) []string {
|
||||
var out []string
|
||||
switch pluginType {
|
||||
case consts.PluginTypeUnknown:
|
||||
case api.PluginTypeUnknown:
|
||||
out = []string{"Name | Type | Version"}
|
||||
for _, plugin := range plugins.Details {
|
||||
out = append(out, fmt.Sprintf("%s | %s | %s", plugin.Name, plugin.Type, plugin.Version))
|
||||
|
||||
Reference in New Issue
Block a user