docker / docker/cli

No name check when there is a dot in service name

Open
#1,470 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/stack area/swarm area/ux
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description
When deplay a service with name "test.com", daemon will return a error.
Shall we need to check the service name in cli? Or update daemon's check to allow dot in service name?

Steps to reproduce the issue:

  1. create file4.yaml with the content in description.
  2. docker stack deploy -c file4.yaml stk4
root@iZ2ze0tktsnis7mhjiyab1Z:~# cat file4.yaml 
version: "3"
services:
  test.com:
    image: redis
root@iZ2ze0tktsnis7mhjiyab1Z:~# docker stack deploy -c file4.yaml stk4
Creating service stk4_test.com
failed to create service stk4_test.com: Error response from daemon: rpc error: code = InvalidArgument desc = name must be valid as a DNS name component

Describe the results you received:
Creating service stk4_test.com
failed to create service stk4_test.com: Error response from daemon: rpc error: code = InvalidArgument desc = name must be valid as a DNS name component

Describe the results you expected:

Service with name "test.com" is not allowed.  Only characters like "^[a-zA-Z0-9](?:[-_]*[A-Za-z0-9]+)*$" are allowed.

Or:

Creating service stk4_test.com
Service stk4_test.com created successfully.

Or:

It's not important. Don't need change anything.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:	18.03.0-ce
 API version:	1.37
 Go version:	go1.9.4
 Git commit:	0520e24
 Built:	Wed Mar 21 23:10:01 2018
 OS/Arch:	linux/amd64
 Experimental:	false
 Orchestrator:	swarm

Server:
 Engine:
  Version:	18.03.0-ce
  API version:	1.37 (minimum version 1.12)
  Go version:	go1.9.4
  Git commit:	0520e24
  Built:	Wed Mar 21 23:08:31 2018
  OS/Arch:	linux/amd64
  Experimental:	false

Output of docker info:

Containers: 11
 Running: 11
 Paused: 0
 Stopped: 0
Images: 39
Server Version: 18.03.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: liej3h97oop7ur5kfatg49ppp
 Is Manager: true
 ClusterID: kee8axgptwa4tdk2sm7dvv970
 Managers: 1
 Nodes: 1
 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: 172.17.254.35
 Manager Addresses:
  172.17.254.35:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-105-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.859GiB
Name: iZ2ze0tktsnis7mhjiyab1Z
ID: OQTM:H2HJ:U2XT:WKLC:U4ZY:EHVI:QTXN:W4GK:QDA4:LUDJ:LFN7:WG3V
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.):
Aliyun cloud

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the docker stack deploy flow described in the reproduction and trace where the service name is checked before the daemon returns its DNS-name error. Determine whether validation belongs in the CLI or daemon, and clarify the intended policy for dots in service names. Done means the project has an agreed behavior and a corresponding regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.