-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
swarm: needless update with --resolve-image changed #34242
Comments
Confirmed, I can reproduce this on; Client:
Version: 17.06.1-ce-rc1
API version: 1.30
Go version: go1.8.3
Git commit: 77b4dce
Built: Fri Jul 14 07:38:15 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.1-ce-rc1
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 77b4dce
Built: Fri Jul 14 07:33:35 2017
OS/Arch: linux/amd64
Experimental: true $ docker stack deploy -c docker-compose.yml repro-34242
Creating network repro-34242_default
Creating service repro-34242_redis
$ docker stack ps repro-34242
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
zf82fdczud3f repro-34242_redis.1 redis:3.2.8 moby Running Running 6 seconds ago Re-deploy the stack $ docker stack deploy -c docker-compose.yml --resolve-image changed repro-34242
Updating service repro-34242_redis (id: mh3im046fem2l4u4x9vrwxfvb)
$ docker stack ps repro-34242
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
s0y54fj3zpyo repro-34242_redis.1 redis:3.2.8 moby Running Running 8 seconds ago
zf82fdczud3f \_ repro-34242_redis.1 redis:3.2.8 moby Shutdown Shutdown 11 seconds ago Compare $ docker service inspect repro-34242_redis -f '{{.Spec.TaskTemplate.ContainerSpec.Image}} <--> {{.PreviousSpec.TaskTemplate.ContainerSpec.Image}}'
redis:3.2.8 <--> redis:3.2.8@sha256:8eb0cd22644dc1218680db876411f45baac493ac9a0bfd391d6efdef0767ea6b Let me open a pull request to fix this |
Not resolved. 👎 Hi, @thaJeztah. I have re-tested this issue on 17.09 and 17.12 and both are still affected. Diffing the task template Spec vs PreviousSpec, I can see difference in..
.. which is mentioned in docker/cli#386 as fixed. Even if that PR was merged to
|
@zarnovican the platform part was removed from that patch, only the image ( |
I'm not able to reproduce this issue on 18.03 (even if #34268 is still open). I'll consider it resolved. Thanks. |
Description
Stack deploy with
--resolve-image changed
will update the service even if the image/tag has not changed.The first
docker stack deploy..
after tag change will update the service as expected. The next deploy will update the service again, even if the tag has not changed. Any subsequent deploy won't update the service (as expected).Steps to reproduce the issue:
test.yaml
Describe the results you received:
In step 3, service
redis
is re-deployed.Describe the results you expected:
Service should not re-deploy, since the tag has not changed.
Additional information you deem important (e.g. issue happens only occasionally):
Presumably, it is because on first deploy (and any tag change), Docker will make a lookup to registry and store image id with sha256 hash. After the second deploy, you can observe that the current image is without the sha256, while the previous spec has it..
Subsequent deploy will not make that lookup and it will asume the image is
redis:3.2.8
. Which will not trigger any update.Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
AWS
The text was updated successfully, but these errors were encountered: