Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering docker services with partial name only works for beginning of script #36332

Open
mitsos1os opened this issue Feb 16, 2018 · 2 comments

Comments

@mitsos1os
Copy link

Description
Running docker service ls -f name=<partial_name_not_from_start> will only match service names that start with this name and not actual partial names

Steps to reproduce the issue:

  1. Create a service with the name my_random_service
  2. Run the command docker service ls -f name=random

Describe the results you received:
No result

Describe the results you expected:
Should return the created my_random_service

Additional information you deem important (e.g. issue happens only occasionally):
Running docker service ls -f name=my_random will return the service. (Filtered name matches beginning of string)

Output of docker version:

Client:
 Version:	17.12.0-ce
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	c97c6d6
 Built:	Wed Dec 27 20:11:19 2017
 OS/Arch:	linux/amd64

Server:
 Engine:
  Version:	17.12.0-ce
  API version:	1.35 (minimum version 1.12)
  Go version:	go1.9.2
  Git commit:	c97c6d6
  Built:	Wed Dec 27 20:09:53 2017
  OS/Arch:	linux/amd64
  Experimental:	false

Output of docker info:

Containers: 53
 Running: 15
 Paused: 0
 Stopped: 38
Images: 42
Server Version: 17.12.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: yhexnya40kom83vwy1kqumi8k
 Is Manager: true
 ClusterID: 5ol4a7ae3296rxun1237wmkv9
 Managers: 3
 Nodes: 3
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 10.0.0.37
 Manager Addresses:
  **SKIPPED**
  **SKIPPED**
  **SKIPPED**
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-1047-aws
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.858GiB
ID: 3ZSQ:7U27:EPWK:BBPT:UWSC:MSJV:5LWR:E5H3:KZ3Z:GGWD:RPIG:G7DD
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Running on AWS

@alexvy86
Copy link

This issue is still there with Docker 18.03.1-ce:

Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:17:20 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:15:30 2018
  OS/Arch:      linux/amd64
  Experimental: false

@alexvy86
Copy link

Also, trying to match the beginning of the name explicitly using ^ (--filter name=^something) doesn't match services whose name does start with something. I thought this might work because that's how docker network ls behaves... but also found out docker ps doesn't support it? Is there a centralized issue somewhere to standardize the behavior of --filter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants