From 45ba926c6d1d26992971e4b215719e3ead369b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 26 Jul 2023 14:52:11 +0200 Subject: [PATCH] daemon/list: Drop unused arg from containerReducer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refreshImage is the only function used as a reducer and it doesn't use the `filter *listContext`. Signed-off-by: Paweł Gronowski (cherry picked from commit 13180c1c4924ac2c8529507cf2405e3afe0a2413) Signed-off-by: Paweł Gronowski --- daemon/list.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/list.go b/daemon/list.go index 5b90fbbede837..5057e188d8840 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -41,7 +41,7 @@ type iterationAction int // containerReducer represents a reducer for a container. // Returns the object to serialize by the api. -type containerReducer func(context.Context, *container.Snapshot, *listContext) (*types.Container, error) +type containerReducer func(context.Context, *container.Snapshot) (*types.Container, error) const ( // includeContainer is the action to include a container in the reducer. @@ -230,7 +230,7 @@ func (daemon *Daemon) reducePsContainer(ctx context.Context, container *containe } // transform internal container struct into api structs - newC, err := reducer(ctx, container, filter) + newC, err := reducer(ctx, container) if err != nil { return nil, err } @@ -600,7 +600,7 @@ func includeContainerInList(container *container.Snapshot, filter *listContext) // $ docker ps -a // CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES // b0318bca5aef 3fbc63216742 "sh" 3 years ago Exited (0) 3 years ago ecstatic_beaver -func (daemon *Daemon) refreshImage(ctx context.Context, s *container.Snapshot, filter *listContext) (*types.Container, error) { +func (daemon *Daemon) refreshImage(ctx context.Context, s *container.Snapshot) (*types.Container, error) { c := s.Container // s.Image is the image reference passed by the user to create an image