Skip to content

Filtering nodes doesn't return a result #27231

@sebgie

Description

@sebgie

Description

Hi, I have started to use 1.12 with it's new features lately. I have a 4 node cluster (1 manager, 3 workers with swarm mode) and try to put workloads on dedicated machines. While doing that I came accross either a bug or something that is missing from documentation?

I have added a label to one of my nodes and then try to execute docker node ls with a filter as described here: https://docs.docker.com/engine/reference/commandline/node_ls/#filtering. Unfortunately I don't get the expected response?

Steps to reproduce the issue:

# docker node update --label-add test dev-swarm-04
dev-swarm-04

# docker node inspect dev-swarm-04
[
    {
        "ID": "7p470z31yf2u27t7wx48og9b0",
        "Version": {
            "Index": 8545
        },
        "CreatedAt": "2016-10-05T13:42:10.303870096Z",
        "UpdatedAt": "2016-10-08T12:15:32.624496559Z",
        "Spec": {
            "Labels": {
                "test": ""
            },
            "Role": "worker",
            "Availability": "active"
        },
        "Description": {
            "Hostname": "dev-swarm-04",
            "Platform": {
                "Architecture": "x86_64",
                "OS": "linux"
            },
            "Resources": {
                "NanoCPUs": 4000000000,
                "MemoryBytes": 8371408896
            },
            "Engine": {
                "EngineVersion": "1.12.1",
                "Plugins": [
                    {
                        "Type": "Network",
                        "Name": "bridge"
                    },
                    {
                        "Type": "Network",
                        "Name": "host"
                    },
                    {
                        "Type": "Network",
                        "Name": "null"
                    },
                    {
                        "Type": "Network",
                        "Name": "overlay"
                    },
                    {
                        "Type": "Volume",
                        "Name": "local"
                    }
                ]
            }
        },
        "Status": {
            "State": "ready"
        }
    }
]

# docker node ls -f label=test
ID  HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS

Describe the results you received:
No nodes found.

Describe the results you expected:
One node (dev-swarm-04) found.

Additional information you deem important (e.g. issue happens only occasionally):
Additonally I couldn't find any documentation how I would use a value with my label.

# docker node ls -f label=test=value?
# docker node ls -f label=test:value?
# docker node ls -f label.test=value?

Using the label as a constraint to create a service works flawlessly 👍.
Thanks for your help :).

Output of docker version:

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:33:38 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:33:38 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 16
 Running: 3
 Paused: 0
 Stopped: 13
Images: 204
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-253:1-916657-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 11.68 GB
 Data Space Total: 107.4 GB
 Data Space Available: 69.87 GB
 Metadata Space Used: 19.42 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.128 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.110 (2015-10-30)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay bridge host null
Swarm: active
 NodeID: 5uzh00gzxmquexfcmurnq6ypm
 Is Manager: true
 ClusterID: 7vryc5c1s75o0jkttokhyo6dc
 Managers: 1
 Nodes: 4
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address: 10.133.13.82
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-36-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 31.42 GiB
Name: dev-swarm-01
ID: 3FQW:TNXG:PUD2:FW4B:FU4Y:YS6E:NYCR:RGET:6SKY:LCOF:FW2G:UOE6
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: sebgieghost
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, VirtualBox, physical, etc.):
Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions