فهرست منبع

daemon/list: Drop unused arg from containerReducer

refreshImage is the only function used as a reducer and it doesn't use
the `filter *listContext`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 2 سال پیش
والد
کامیت
13180c1c49
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      daemon/list.go

+ 3 - 3
daemon/list.go

@@ -42,7 +42,7 @@ type iterationAction int
 
 
 // containerReducer represents a reducer for a container.
 // containerReducer represents a reducer for a container.
 // Returns the object to serialize by the api.
 // 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 (
 const (
 	// includeContainer is the action to include a container in the reducer.
 	// includeContainer is the action to include a container in the reducer.
@@ -231,7 +231,7 @@ func (daemon *Daemon) reducePsContainer(ctx context.Context, container *containe
 	}
 	}
 
 
 	// transform internal container struct into api structs
 	// transform internal container struct into api structs
-	newC, err := reducer(ctx, container, filter)
+	newC, err := reducer(ctx, container)
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}
@@ -600,7 +600,7 @@ func includeContainerInList(container *container.Snapshot, filter *listContext)
 // $ docker ps -a
 // $ docker ps -a
 // CONTAINER ID   IMAGE          COMMAND   CREATED       STATUS                  PORTS     NAMES
 // CONTAINER ID   IMAGE          COMMAND   CREATED       STATUS                  PORTS     NAMES
 // b0318bca5aef   3fbc63216742   "sh"      3 years ago   Exited (0) 3 years ago            ecstatic_beaver
 // 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
 	c := s.Container
 
 
 	// s.Image is the image reference passed by the user to create an image
 	// s.Image is the image reference passed by the user to create an image