|
|
@@ -41,12 +41,12 @@ const (
|
|
|
oneOffOnly
|
|
|
)
|
|
|
|
|
|
-func (s *composeService) getContainers(ctx context.Context, project string, oneOff oneOff, stopped bool, selectedServices ...string) (Containers, error) {
|
|
|
+func (s *composeService) getContainers(ctx context.Context, project string, oneOff oneOff, all bool, selectedServices ...string) (Containers, error) {
|
|
|
var containers Containers
|
|
|
f := getDefaultFilters(project, oneOff, selectedServices...)
|
|
|
containers, err := s.apiClient().ContainerList(ctx, containerType.ListOptions{
|
|
|
Filters: filters.NewArgs(f...),
|
|
|
- All: stopped,
|
|
|
+ All: all,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
@@ -73,7 +73,7 @@ func getDefaultFilters(projectName string, oneOff oneOff, selectedServices ...st
|
|
|
return f
|
|
|
}
|
|
|
|
|
|
-func (s *composeService) getSpecifiedContainer(ctx context.Context, projectName string, oneOff oneOff, stopped bool, serviceName string, containerIndex int) (moby.Container, error) {
|
|
|
+func (s *composeService) getSpecifiedContainer(ctx context.Context, projectName string, oneOff oneOff, all bool, serviceName string, containerIndex int) (moby.Container, error) {
|
|
|
defaultFilters := getDefaultFilters(projectName, oneOff, serviceName)
|
|
|
if containerIndex > 0 {
|
|
|
defaultFilters = append(defaultFilters, containerNumberFilter(containerIndex))
|
|
|
@@ -82,7 +82,7 @@ func (s *composeService) getSpecifiedContainer(ctx context.Context, projectName
|
|
|
Filters: filters.NewArgs(
|
|
|
defaultFilters...,
|
|
|
),
|
|
|
- All: stopped,
|
|
|
+ All: all,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return moby.Container{}, err
|