mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api, client: don't use a pointer-slice for plugins
The backend and router don't use a pointer-slice (the server actually doesn't use the `plugin.ListResponse` type and a straight slice);778e5bfad3/daemon/server/router/plugin/backend.go (L20)6baf274fa3/daemon/server/router/plugin/plugin_routes.go (L276-L280)Align the type in the API to match, and update the type defined in the client accordingly. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ListResponse contains the response for the Engine API
|
// ListResponse contains the response for the Engine API
|
||||||
type ListResponse []*Plugin
|
type ListResponse []Plugin
|
||||||
|
|
||||||
// Privilege describes a permission the user has to accept
|
// Privilege describes a permission the user has to accept
|
||||||
// upon installing a plugin.
|
// upon installing a plugin.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type PluginListOptions struct {
|
|||||||
|
|
||||||
// PluginListResult represents the result of a plugin list operation.
|
// PluginListResult represents the result of a plugin list operation.
|
||||||
type PluginListResult struct {
|
type PluginListResult struct {
|
||||||
Items []*plugin.Plugin
|
Items []plugin.Plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
// PluginList returns the installed plugins
|
// PluginList returns the installed plugins
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func TestPluginList(t *testing.T) {
|
|||||||
return nil, fmt.Errorf("%s not set in URL query properly. Expected '%s', got %s", key, expected, actual)
|
return nil, fmt.Errorf("%s not set in URL query properly. Expected '%s', got %s", key, expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mockJSONResponse(http.StatusOK, nil, []*plugin.Plugin{
|
return mockJSONResponse(http.StatusOK, nil, []plugin.Plugin{
|
||||||
{ID: "plugin_id1"},
|
{ID: "plugin_id1"},
|
||||||
{ID: "plugin_id2"},
|
{ID: "plugin_id2"},
|
||||||
})(req)
|
})(req)
|
||||||
|
|||||||
2
vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go
generated
vendored
2
vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go
generated
vendored
@@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ListResponse contains the response for the Engine API
|
// ListResponse contains the response for the Engine API
|
||||||
type ListResponse []*Plugin
|
type ListResponse []Plugin
|
||||||
|
|
||||||
// Privilege describes a permission the user has to accept
|
// Privilege describes a permission the user has to accept
|
||||||
// upon installing a plugin.
|
// upon installing a plugin.
|
||||||
|
|||||||
2
vendor/github.com/moby/moby/client/plugin_list.go
generated
vendored
2
vendor/github.com/moby/moby/client/plugin_list.go
generated
vendored
@@ -15,7 +15,7 @@ type PluginListOptions struct {
|
|||||||
|
|
||||||
// PluginListResult represents the result of a plugin list operation.
|
// PluginListResult represents the result of a plugin list operation.
|
||||||
type PluginListResult struct {
|
type PluginListResult struct {
|
||||||
Items []*plugin.Plugin
|
Items []plugin.Plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
// PluginList returns the installed plugins
|
// PluginList returns the installed plugins
|
||||||
|
|||||||
Reference in New Issue
Block a user