Merge pull request #7 from gdevillele/pr-fix-service-ls-filter

remove service runtime filter from client
This commit is contained in:
Gaetan
2017-04-28 10:48:25 -07:00
committed by GitHub
2 changed files with 1 additions and 7 deletions
+1 -3
View File
@@ -45,9 +45,7 @@ func runList(dockerCli *command.DockerCli, opts listOptions) error {
ctx := context.Background()
client := dockerCli.Client()
serviceFilters := opts.filter.Value()
serviceFilters.Add("runtime", string(swarm.RuntimeContainer))
services, err := client.ServiceList(ctx, types.ServiceListOptions{Filters: serviceFilters})
services, err := client.ServiceList(ctx, types.ServiceListOptions{})
if err != nil {
return err
}
-4
View File
@@ -13,7 +13,6 @@ import (
"github.com/docker/cli/cli/command/task"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/opts"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@@ -59,11 +58,8 @@ func runPS(dockerCli *command.DockerCli, opts psOptions) error {
serviceIDFilter := filters.NewArgs()
serviceNameFilter := filters.NewArgs()
for _, service := range opts.services {
// default to container runtime
serviceIDFilter.Add("id", service)
serviceIDFilter.Add("runtime", string(swarmtypes.RuntimeContainer))
serviceNameFilter.Add("name", service)
serviceNameFilter.Add("runtime", string(swarmtypes.RuntimeContainer))
}
serviceByIDList, err := client.ServiceList(ctx, types.ServiceListOptions{Filters: serviceIDFilter})
if err != nil {