This repository was archived by the owner on Oct 13, 2023. It is now read-only.
[19.03 backport] Handle the error case when a container reattaches to the same network #279
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.
backport of moby#39137 for 19.03
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)