Do not allow removal of networks with attached tasks#1724
Closed
mavenugo wants to merge 1 commit intomoby:masterfrom
Closed
Do not allow removal of networks with attached tasks#1724mavenugo wants to merge 1 commit intomoby:masterfrom
mavenugo wants to merge 1 commit intomoby:masterfrom
Conversation
added checks in control-api to prevent network with attached tasks from being removed. Signed-off-by: Madhu Venugopal <madhu@docker.com>
Contributor
Author
|
ping @mrjana |
Current coverage is 56.05% (diff: 36.36%)@@ master #1724 diff @@
==========================================
Files 96 96
Lines 14902 14913 +11
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 8321 8360 +39
+ Misses 5474 5445 -29
- Partials 1107 1108 +1
|
dongluochen
reviewed
Nov 1, 2016
| return nil, grpc.Errorf(codes.Internal, "could not find tasks using network %s", request.NetworkID) | ||
| } | ||
|
|
||
| for _, t := range tasks { |
Contributor
There was a problem hiding this comment.
This sounds very expensive in a big cluster with 1 million containers (tasks).
Contributor
Author
There was a problem hiding this comment.
@mrjana do you know of a better way to handle this ?
Contributor
There was a problem hiding this comment.
@dongluochen Yes it is very expensive but I am afraid there is no other simple way at this point since go-memdb cannot create an index which satisfies an OR of multiple fields in an object(or a field which is a slice and we need an index which satisfies each entry in the slice).
Contributor
Author
|
#1728 took care of the changes. closing it. |
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.
added checks in control-api to prevent network with attached tasks from being removed.
Fixes #1692
But ideally this PR must go in alongside the fix for #440 as described in #1692 (comment)
Signed-off-by: Madhu Venugopal madhu@docker.com