updater: Check entire service spec when deciding whether to replace ongoing update#1497
Merged
aaronlehmann merged 1 commit intomoby:masterfrom Sep 6, 2016
Merged
Conversation
|
|
||
| if update, ok := u.updates[id]; ok { | ||
| if !update.isServiceDirty(service) { | ||
| if reflect.DeepEqual(service.Spec, update.newService.Spec) { |
Collaborator
There was a problem hiding this comment.
Why not modify isServiceDirty? This is the only place that method is called.
Collaborator
There was a problem hiding this comment.
Alternatively, if the better way to do things is the way it's done here, isServiceDirty is unused and should be removed.
Collaborator
Author
There was a problem hiding this comment.
Removed isServiceDirty.
Current coverage is 55.49% (diff: 0.00%)@@ master #1497 diff @@
==========================================
Files 82 82
Lines 12885 12882 -3
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 7138 7149 +11
+ Misses 4757 4750 -7
+ Partials 990 983 -7
|
…ngoing update Currently, updater checks isServiceDirty to decide whether an existing update should be restarted. This only checks the task spec and the endpoint spec, so it will ignore changes to fields like UpdateConfig. For example, it's not possible to change just the parallelism while an update is already in progress. Fix this by comparing the whole spec. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
8bda028 to
f2ba23b
Compare
Collaborator
|
LGTM |
1 similar comment
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, updater checks
isServiceDirtyto decide whether an existingupdate should be restarted. This only checks the task spec and the
endpoint spec, so it will ignore changes to fields like UpdateConfig.
For example, it's not possible to change just the parallelism while an
update is already in progress. Fix this by comparing the whole spec.
cc @dongluochen @pnickolov