mirror of https://github.com/docker/cli.git
Merge pull request #29716 from yongtang/28885-docker-stack-ps-all
Remove `docker stack ps -a` to match removal of `docker service/node ps -a`
This commit is contained in:
commit
0f686b1e45
|
@ -6,7 +6,6 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
|
||||||
"github.com/docker/docker/cli"
|
"github.com/docker/docker/cli"
|
||||||
"github.com/docker/docker/cli/command"
|
"github.com/docker/docker/cli/command"
|
||||||
"github.com/docker/docker/cli/command/idresolver"
|
"github.com/docker/docker/cli/command/idresolver"
|
||||||
|
@ -16,7 +15,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type psOptions struct {
|
type psOptions struct {
|
||||||
all bool
|
|
||||||
filter opts.FilterOpt
|
filter opts.FilterOpt
|
||||||
noTrunc bool
|
noTrunc bool
|
||||||
namespace string
|
namespace string
|
||||||
|
@ -36,7 +34,6 @@ func newPsCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
flags.BoolVarP(&opts.all, "all", "a", false, "Display all tasks")
|
|
||||||
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate output")
|
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate output")
|
||||||
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
|
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
|
||||||
flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
|
flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
|
||||||
|
@ -50,10 +47,6 @@ func runPS(dockerCli *command.DockerCli, opts psOptions) error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
filter := getStackFilterFromOpt(opts.namespace, opts.filter)
|
filter := getStackFilterFromOpt(opts.namespace, opts.filter)
|
||||||
if !opts.all && !filter.Include("desired-state") {
|
|
||||||
filter.Add("desired-state", string(swarm.TaskStateRunning))
|
|
||||||
filter.Add("desired-state", string(swarm.TaskStateAccepted))
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks, err := client.TaskList(ctx, types.TaskListOptions{Filters: filter})
|
tasks, err := client.TaskList(ctx, types.TaskListOptions{Filters: filter})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue