The docker node ls command takes a --format option to customize the output. My nodes are labeled with metadata like the availability zone and node group name. It would be really useful to be able to output labels when listing nodes.
Steps to reproduce the issue:
Attempt to output a list of nodes with foo labels.
docker node ls --format 'table {{ .ID }}\t{{ .Label.foo }}'
Describe the results you received:
It is not possible to output all labels, or a specific label.
Template parsing error: template: :1:19: executing "" at <.Label.foo>: can't evaluate field Label in type *node.nodeContext
Describe the results you expected:
An option to output one or more labels.
Additional information you deem important (e.g. issue happens only occasionally):
It is possible to filter nodes by label.
docker node ls --filter "label=foo"
Output of docker version:
Client: Docker Engine - Community
Version: 19.03.0-rc2
API version: 1.39 (downgraded from 1.40)
Go version: go1.12.5
Git commit: f97efcc
Built: Wed Jun 5 01:37:53 2019
OS/Arch: darwin/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 18.09.6
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 02:02:43 2019
OS/Arch: linux/amd64
Experimental: false
Description
The
docker node ls
command takes a--format
option to customize the output. My nodes are labeled with metadata like the availability zone and node group name. It would be really useful to be able to output labels when listing nodes.Steps to reproduce the issue:
Describe the results you received:
It is not possible to output all labels, or a specific label.
Describe the results you expected:
An option to output one or more labels.
Additional information you deem important (e.g. issue happens only occasionally):
It is possible to filter nodes by label.
Output of
docker version
:Output of
docker info
:N/A
Additional environment details (AWS, VirtualBox, physical, etc.):