Skip to content

"docker service update" - updates service unconditionally #33865

@shkrid

Description

@shkrid

Description
docker service update - updates service all time

Steps to reproduce the issue:

  1. docker service create
    --name=swarm_gui
    --publish=9080:8080/tcp
    --constraint=node.role==manager
    --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock
    dockersamples/visualizer
  2. docker service update swarm_gui
  3. docker service inspect swarm_gui > /tmp/before
  4. docker service update --image dockersamples/visualizer swarm_gui
  5. docker service inspect swarm_gui > /tmp/after

Describe the results you received:
Service updates unconditionally

Describe the results you expected:
Service should not be updated if nothing was changed

Additional information you deem important (e.g. issue happens only occasionally):
Why additional platform block added?
{"Architecture": "amd64", "OS": "linux"}

$ diff -u /tmp/before /tmp/after
--- /tmp/before	2017-06-28 23:34:21.000000000 +0300
+++ /tmp/after	2017-06-28 23:35:44.000000000 +0300
@@ -2,10 +2,10 @@
     {
         "ID": "wwc52rcsjlk1egh9m45ayut9i",
         "Version": {
-            "Index": 842990
+            "Index": 843004
         },
         "CreatedAt": "2017-06-28T20:32:37.969352027Z",
-        "UpdatedAt": "2017-06-28T20:33:46.379054444Z",
+        "UpdatedAt": "2017-06-28T20:35:23.023603498Z",
         "Spec": {
             "Name": "swarm_gui",
             "Labels": {},
@@ -39,6 +39,10 @@
                         {
                             "Architecture": "amd64",
                             "OS": "linux"
+                        },
+                        {
+                            "Architecture": "amd64",
+                            "OS": "linux"
                         }
                     ]
                 },
@@ -152,6 +156,12 @@
                     "Addr": "10.255.0.2/16"
                 }
             ]
+        },
+        "UpdateStatus": {
+            "State": "completed",
+            "StartedAt": "2017-06-28T20:35:02.669335975Z",
+            "CompletedAt": "2017-06-28T20:35:23.023577205Z",
+            "Message": "update completed"
         }
     }
 ]

Output of docker version:

Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:31:53 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:51:55 2017
 OS/Arch:      linux/amd64
 Experimental: true

Output of docker info:

Containers: 38
 Running: 3
 Paused: 0
 Stopped: 35
Images: 130
Server Version: 17.06.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 415
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: 86pxfphstvmoffw6q9mo98r8k
 Is Manager: true
 ClusterID: x36csyrrl8vay1zwrjfn9blm3
 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
 Root Rotation In Progress: false
 Node Address: 192.168.65.2
 Manager Addresses:
  172.17.0.1:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.31-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: moby
ID: TUZX:CVMS:RV4M:QM5Y:QVXT:7ZY3:LP4I:4WV5:TEOW:2C4C:F3H5:XI2K
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 61
 Goroutines: 205
 System Time: 2017-06-28T20:25:38.558095597Z
 EventsListeners: 4
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
Docker-for-mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/swarmkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.version/17.06

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions