-
Notifications
You must be signed in to change notification settings - Fork 881
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
Remove driver endpoints on network deleting #1333
Conversation
Agree with the idea, but this covers only a corner case where the drivers' endpoints are out of sync with libnetwork endpoints. During normal operation there should never be stale driver endpoints on Deletenetwork(). The stale endpoints would happen on ungraceful shutdown of the daemon. And the code to get rid of the stale endpoints in already in place when the drivers initialize. I am not against the change, but I would not include it in docker 1.12 yet. |
@aboch I'm ok with this not included in docker 1.12 |
|
@@ -753,6 +753,17 @@ func (d *driver) DeleteNetwork(nid string) error { | |||
config := n.config | |||
n.Unlock() | |||
|
|||
// delele endpoints belong to this network | |||
for _, ep := range n.endpoints { |
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.
@coolljt0725
Just to be safe, can you please also add the following:
if err := n.releasePorts(endpoint); err != nil {
logrus.Warn(err)
}
cac00d7
to
045f49e
Compare
@aboch updated |
@@ -753,6 +753,20 @@ func (d *driver) DeleteNetwork(nid string) error { | |||
config := n.config | |||
n.Unlock() | |||
|
|||
// delele endpoints belong to this network | |||
for _, ep := range n.endpoints { | |||
if err := n.releasePorts(endpoint); err != nil { |
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.
endpoint
-> ep
Thanks, also pls rebase to latest so that CI would get a chance to run. |
045f49e
to
2027525
Compare
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2027525
to
b757f57
Compare
@aboch rebased |
Thanks @coolljt0725 LGTM |
… of LinkByName is NULL Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
fix for #1333, calling LinkDel to delete link device when the err is NULL
… of LinkByName is NULL Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
Signed-off-by: Lei Jitang leijitang@huawei.com
On driver deleting network, we should also remove the endpoints belong to it if
there are endpoints remain, or else the endpoints in the store would never been removed.
ping @aboch