mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
backport of commit f96ecf3800 (#22875)
Co-authored-by: Thy Ton <maithytonn@gmail.com>
This commit is contained in:
committed by
GitHub
parent
6238fc261e
commit
2bcb412b82
@@ -36,6 +36,8 @@ type ListPluginsResponse struct {
|
|||||||
type PluginDetails struct {
|
type PluginDetails struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
OCIImage string `json:"oci_image,omitempty" mapstructure:"oci_image"`
|
||||||
|
Runtime string `json:"runtime,omitempty"`
|
||||||
Version string `json:"version,omitempty"`
|
Version string `json:"version,omitempty"`
|
||||||
Builtin bool `json:"builtin"`
|
Builtin bool `json:"builtin"`
|
||||||
DeprecationStatus string `json:"deprecation_status,omitempty" mapstructure:"deprecation_status"`
|
DeprecationStatus string `json:"deprecation_status,omitempty" mapstructure:"deprecation_status"`
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ func (c *PluginListCommand) simpleResponse(plugins *api.ListPluginsResponse, plu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PluginListCommand) detailedResponse(plugins *api.ListPluginsResponse) []string {
|
func (c *PluginListCommand) detailedResponse(plugins *api.ListPluginsResponse) []string {
|
||||||
out := []string{"Name | Type | Version | Deprecation Status"}
|
out := []string{"Name | Type | Version | Container | Deprecation Status"}
|
||||||
for _, plugin := range plugins.Details {
|
for _, plugin := range plugins.Details {
|
||||||
out = append(out, fmt.Sprintf("%s | %s | %s | %s", plugin.Name, plugin.Type, plugin.Version, plugin.DeprecationStatus))
|
out = append(out, fmt.Sprintf("%s | %s | %s | %v | %s", plugin.Name, plugin.Type, plugin.Version, plugin.OCIImage != "", plugin.DeprecationStatus))
|
||||||
}
|
}
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ type VersionedPlugin struct {
|
|||||||
Type string `json:"type"` // string instead of consts.PluginType so that we get the string form in API responses.
|
Type string `json:"type"` // string instead of consts.PluginType so that we get the string form in API responses.
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
|
OCIImage string `json:"oci_image,omitempty"`
|
||||||
|
Runtime string `json:"runtime,omitempty"`
|
||||||
SHA256 string `json:"sha256,omitempty"`
|
SHA256 string `json:"sha256,omitempty"`
|
||||||
Builtin bool `json:"builtin"`
|
Builtin bool `json:"builtin"`
|
||||||
DeprecationStatus string `json:"deprecation_status,omitempty"`
|
DeprecationStatus string `json:"deprecation_status,omitempty"`
|
||||||
|
|||||||
@@ -467,6 +467,12 @@ func (b *SystemBackend) handlePluginCatalogUntypedList(ctx context.Context, _ *l
|
|||||||
"version": p.Version,
|
"version": p.Version,
|
||||||
"builtin": p.Builtin,
|
"builtin": p.Builtin,
|
||||||
}
|
}
|
||||||
|
if p.OCIImage != "" {
|
||||||
|
entry["oci_image"] = p.OCIImage
|
||||||
|
}
|
||||||
|
if p.Runtime != "" {
|
||||||
|
entry["runtime"] = p.Runtime
|
||||||
|
}
|
||||||
if p.SHA256 != "" {
|
if p.SHA256 != "" {
|
||||||
entry["sha256"] = p.SHA256
|
entry["sha256"] = p.SHA256
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1122,6 +1122,8 @@ func (c *PluginCatalog) listInternal(ctx context.Context, pluginType consts.Plug
|
|||||||
result = append(result, pluginutil.VersionedPlugin{
|
result = append(result, pluginutil.VersionedPlugin{
|
||||||
Name: plugin.Name,
|
Name: plugin.Name,
|
||||||
Type: plugin.Type.String(),
|
Type: plugin.Type.String(),
|
||||||
|
OCIImage: plugin.OCIImage,
|
||||||
|
Runtime: plugin.Runtime,
|
||||||
Version: plugin.Version,
|
Version: plugin.Version,
|
||||||
SHA256: hex.EncodeToString(plugin.Sha256),
|
SHA256: hex.EncodeToString(plugin.Sha256),
|
||||||
SemanticVersion: semanticVersion,
|
SemanticVersion: semanticVersion,
|
||||||
|
|||||||
Reference in New Issue
Block a user