-
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
Make docker stack deploy a little bit more indempotent #30506
Make docker stack deploy a little bit more indempotent #30506
Conversation
Sort some slice fields before sending them to the swarm api so that it won't trigger an update. Signed-off-by: Vincent Demeester <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ping @docker/core-engine-maintainers |
LGTM |
I'm seeing the same problem caused by secrets not being sorted. From nosing at the code, I don't think that was fixed in here, though it looks like secrets are handled slightly differently, so please let me know if I'm wrong. I'll happily open a separate ticket for secrets if that's the best way forward. |
@DrSolaris thanks for reporting; can you open a new issue for that for tracking? (you can include a link to this issue in the description) |
…-indempotent Make docker stack deploy a little bit more indempotent
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf32bbcc49ff3f8201b6da26aba567aa58e) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf32bbcc49ff3f8201b6da26aba567aa58e) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> Upstream-commit: 27e8bdf32bbcc49ff3f8201b6da26aba567aa58e Component: cli
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf32bbcc49ff3f8201b6da26aba567aa58e) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`docker stack deploy` keeps restarting services it doesn't need to (no changes) because the entries' order gets randomized at some previous (de)serialization. Maybe it would be worth looking into this at a higher level and ensure all (de)serialization happens in an ordered collection. This quick fix sorts secrets and configs (in place, mutably) which ensures the same order for each run. Based on moby/moby#30506 Fixes moby/moby#34746 Signed-off-by: Peter Nagy <[email protected]> (cherry picked from commit 27e8bdf) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Version of #29732 for master.
Make sure running multiple times
docker stack deploy --compose-file docker-compose.yml foo
on the same unchanged file doesn't update the services each times. This is mainly due to the use ofmap
.This is related to #29676
This is sorting
environment
,extraHost
andport
too.There is some weirdiness with ports but a PR might follow for that.You can reproduce and validate this using the following compose file.This also helps with
Error response from daemon: rpc error: code = 2 desc = changing network in service is not supported
when you didn't change the networks./cc @thaJeztah @dnephin @icecrime @cpuguy83 @aaronlehmann @aanand
If it gets in, I'll do a PR against master.
Signed-off-by: Vincent Demeester [email protected]
Signed-off-by: Vincent Demeester [email protected]