-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sort secrets and configs to ensure idempotence #509
sort secrets and configs to ensure idempotence #509
Conversation
Codecov Report
@@ Coverage Diff @@
## master #509 +/- ##
==========================================
- Coverage 49.01% 48.99% -0.03%
==========================================
Files 199 199
Lines 16392 16402 +10
==========================================
+ Hits 8035 8036 +1
- Misses 7939 7948 +9
Partials 418 418 |
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.
Thanks. It looks like ParseSecrets()
and ParseConfigs()
do randomize the order of these unfortunately.
I think sorting is the correct solution, but I don't think the sort belongs in this function. Could you please move it to convertServiceSecrets()
and convertServiceConfigObjs()
b03cbbb
to
34f8c0f
Compare
`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]>
34f8c0f
to
27e8bdf
Compare
refactored as requested |
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
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 🐮
How's this tested? |
@mghazizadeh the steps are given on the upstream PR: moby/moby#34746 |
Related PR : docker#509 Signed-off-by: Vincent Demeester <[email protected]>
Related PR : docker#509 Signed-off-by: Vincent Demeester <[email protected]>
Related PR : docker#509 Signed-off-by: Vincent Demeester <[email protected]>
Related PR : docker#509 Signed-off-by: Vincent Demeester <[email protected]>
Related PR : docker#509 Signed-off-by: Vincent Demeester <[email protected]>
@mghazizadeh test was added in #719 |
Related PR : docker/cli#509 Signed-off-by: Vincent Demeester <[email protected]> Upstream-commit: 5ed399e58873944bf5e992284c751a200417318c 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