-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix #19477, clean up the ports when release network #19483
Conversation
LGTM 🐹 |
@@ -999,6 +999,9 @@ func (daemon *Daemon) releaseNetwork(container *container.Container) { | |||
|
|||
sid := container.NetworkSettings.SandboxID | |||
settings := container.NetworkSettings.Networks | |||
if container.NetworkSettings.Ports != 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.
Maybe just set container.NetworkSettings.Ports = nil
no matter what and avoid the if branch.
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 apart from minor nit, but if we need to merge as-is i'm fine too. |
LGTM. @tiborvass +1. |
ae7d208
to
6025517
Compare
updated as @cpuguy83 's suggestion |
LGTM |
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Fix #19477, clean up the ports when release network
Signed-off-by: Lei Jitang leijitang@huawei.com
Closes #19477
ping @ibuildthecloud @aboch @mavenugo