mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 09:42:25 +00:00
add oci_image and runtime to VersionedPlugin (#22866)
--------- Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,8 @@ type ListPluginsResponse struct {
|
||||
type PluginDetails struct {
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
OCIImage string `json:"oci_image,omitempty" mapstructure:"oci_image"`
|
||||
Runtime string `json:"runtime,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
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 {
|
||||
out := []string{"Name | Type | Version | Deprecation Status"}
|
||||
out := []string{"Name | Type | Version | Container | Deprecation Status"}
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
OCIImage string `json:"oci_image,omitempty"`
|
||||
Runtime string `json:"runtime,omitempty"`
|
||||
SHA256 string `json:"sha256,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
DeprecationStatus string `json:"deprecation_status,omitempty"`
|
||||
|
||||
@@ -467,6 +467,12 @@ func (b *SystemBackend) handlePluginCatalogUntypedList(ctx context.Context, _ *l
|
||||
"version": p.Version,
|
||||
"builtin": p.Builtin,
|
||||
}
|
||||
if p.OCIImage != "" {
|
||||
entry["oci_image"] = p.OCIImage
|
||||
}
|
||||
if p.Runtime != "" {
|
||||
entry["runtime"] = p.Runtime
|
||||
}
|
||||
if 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{
|
||||
Name: plugin.Name,
|
||||
Type: plugin.Type.String(),
|
||||
OCIImage: plugin.OCIImage,
|
||||
Runtime: plugin.Runtime,
|
||||
Version: plugin.Version,
|
||||
SHA256: hex.EncodeToString(plugin.Sha256),
|
||||
SemanticVersion: semanticVersion,
|
||||
|
||||
Reference in New Issue
Block a user