Skip to content

docker service ps does not group global services' tasks together properly #533

Description

@wsong

Description

docker service ps for a service is supposed to group tasks together by slot, but global services don't have a slot. It looks here like the intention is that tasks running on the same node should get grouped together and historical tasks should get a \_ prefix so that they get indented under their other tasks on that same node:

https://github.com/docker/cli/blob/master/cli/command/task/print.go#L71

But this doesn't work because we sort tasks by slot:

https://github.com/docker/cli/blob/master/cli/command/task/print.go#L15

But global services' tasks don't have a slot.

Steps to reproduce the issue:

  1. Create a global service on multiple nodes
  2. Run docker service ps on that node
  3. See that the service's tasks are not sorted by node

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions