From 15a048c396e479894312bd9ad83b0cfeb44f7c6c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 7 Nov 2025 19:31:00 +0100 Subject: [PATCH] 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); https://github.com/moby/moby/blob/778e5bfad3098bcc1b1457634e14c1c204ebf851/daemon/server/router/plugin/backend.go#L20 https://github.com/moby/moby/blob/6baf274fa3e90731ac653967cb0cea38e82b5e36/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 --- api/types/plugin/plugin_responses.go | 2 +- client/plugin_list.go | 2 +- client/plugin_list_test.go | 2 +- .../github.com/moby/moby/api/types/plugin/plugin_responses.go | 2 +- vendor/github.com/moby/moby/client/plugin_list.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/types/plugin/plugin_responses.go b/api/types/plugin/plugin_responses.go index 939e4f59fb..91b327eb47 100644 --- a/api/types/plugin/plugin_responses.go +++ b/api/types/plugin/plugin_responses.go @@ -5,7 +5,7 @@ import ( ) // ListResponse contains the response for the Engine API -type ListResponse []*Plugin +type ListResponse []Plugin // Privilege describes a permission the user has to accept // upon installing a plugin. diff --git a/client/plugin_list.go b/client/plugin_list.go index d613b88453..cbd90b407a 100644 --- a/client/plugin_list.go +++ b/client/plugin_list.go @@ -15,7 +15,7 @@ type PluginListOptions struct { // PluginListResult represents the result of a plugin list operation. type PluginListResult struct { - Items []*plugin.Plugin + Items []plugin.Plugin } // PluginList returns the installed plugins diff --git a/client/plugin_list_test.go b/client/plugin_list_test.go index 170373c4bc..de3761896f 100644 --- a/client/plugin_list_test.go +++ b/client/plugin_list_test.go @@ -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 mockJSONResponse(http.StatusOK, nil, []*plugin.Plugin{ + return mockJSONResponse(http.StatusOK, nil, []plugin.Plugin{ {ID: "plugin_id1"}, {ID: "plugin_id2"}, })(req) diff --git a/vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go b/vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go index 939e4f59fb..91b327eb47 100644 --- a/vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go +++ b/vendor/github.com/moby/moby/api/types/plugin/plugin_responses.go @@ -5,7 +5,7 @@ import ( ) // ListResponse contains the response for the Engine API -type ListResponse []*Plugin +type ListResponse []Plugin // Privilege describes a permission the user has to accept // upon installing a plugin. diff --git a/vendor/github.com/moby/moby/client/plugin_list.go b/vendor/github.com/moby/moby/client/plugin_list.go index d613b88453..cbd90b407a 100644 --- a/vendor/github.com/moby/moby/client/plugin_list.go +++ b/vendor/github.com/moby/moby/client/plugin_list.go @@ -15,7 +15,7 @@ type PluginListOptions struct { // PluginListResult represents the result of a plugin list operation. type PluginListResult struct { - Items []*plugin.Plugin + Items []plugin.Plugin } // PluginList returns the installed plugins