Handle the error case when a container reattaches to the same network#39137
Handle the error case when a container reattaches to the same network#39137thaJeztah merged 2 commits intomoby:masterfrom
Conversation
|
@mavenugo PTAL |
34c89c3 to
925e18c
Compare
Codecov Report
@@ Coverage Diff @@
## master #39137 +/- ##
=========================================
Coverage ? 37.01%
=========================================
Files ? 612
Lines ? 45434
Branches ? 0
=========================================
Hits ? 16816
Misses ? 26333
Partials ? 2285 |
925e18c to
438f910
Compare
|
Wondering; should we actually error, or treat this as a no-op (i.e., make network connect be idempotent)? |
retries to attach to a network, it is already connected to Fixes - docker/for-linux#632 Signed-off-by: Arko Dasgupta <[email protected]>
438f910 to
871acb1
Compare
e47c9c4 to
52ed152
Compare
52ed152 to
b5cbf94
Compare
Signed-off-by: Arko Dasgupta <[email protected]>
b5cbf94 to
31e8fcc
Compare
|
Derek add label: rebuild/* |
|
Derek add label: rebuild/* |
|
Wow, this is weird. |
|
The issue seems to be that the way the code is structured we are modifying the container object before things have even happened. |
|
Ping need another reviewer. |
|
@thaJeztah PTAL |
thaJeztah
left a comment
There was a problem hiding this comment.
whoops, my bad, thought I left mine already
LGTM
|
CI passed 5 days ago, but merging this broke master because of #39332 |
fixes docker/for-linux#632
Signed-off-by: Arko Dasgupta [email protected]
- What I did
Made sure the Networks context is manipulated in the scenario when a container attempts to attach to an a network it is already connected to
- How I did it
When attaching to a network in
findAndAttachNetworkmake sure you return with an error when that network is already part ofcontainer.NetworkSettings.Networks- How to verify it
Followed the same steps in the issue and made sure it is resolved
- Description for the changelog
Fix an issue where connecting a container to a network it's already connected to removes its IP address.
- A picture of a cute animal (not mandatory but encouraged)