Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

[18.09 backport] Handle the error case when a container reattaches to the same network #278

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 12, 2019

backport of moby#39137 for 18.09

fixes docker/for-linux#632

Signed-off-by: Arko Dasgupta arko.dasgupta@docker.com

- 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 findAndAttachNetwork make sure you return with an error when that network is already part of container.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)

@thaJeztah thaJeztah added this to the 18.09.7 milestone Jun 12, 2019
@thaJeztah
Copy link
Member Author

ping @arkodg @cpuguy83

Copy link

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Member Author

Janky failed on a flaky; (tracked through moby#38521)

10:43:27 FAIL: docker_cli_start_test.go:190: DockerSuite.TestStartReturnCorrectExitCode
10:43:27 
10:43:27 assertion failed: expected an error, got nil

RS1 failed on https://jenkins.dockerproject.org/job/Docker-PRs-WoW-RS1/25585/console, which will be fixed once #263 is merged

09:46:40 FAIL: check_test.go:107: DockerSuite.TearDownTest
09:46:40 
09:46:40 assertion failed: error is not nil: Error response from daemon: failed to detach VHD: The system cannot find the file specified.: rename D:\CI\CI-4e3a9fe930\daemon\windowsfilter\b769c9cdb7bb55816488aa141650bcc124a061f4492a4aff580131633fc634a4 D:\CI\CI-4e3a9fe930\daemon\windowsfilter\b769c9cdb7bb55816488aa141650bcc124a061f4492a4aff580131633fc634a4-removing: Access is denied.: failed to remove image sha256:011f5cbc7137249c8fb56ba3eb69dc09269c788efa2fdee07f230f6742b56fe6
09:46:40 
09:46:40 ----------------------------------------------------------------------
09:46:40 PANIC: docker_api_build_test.go:25: DockerSuite.TestBuildAPIDockerFileRemote
09:46:40 
09:46:40 ... Panic: Fixture has panicked (see related PANIC)

@thaJeztah thaJeztah force-pushed the 18.09_backport_attach_to_existing_network_error branch from 4e3a9fe to 073ee4a Compare June 18, 2019 12:36
@thaJeztah
Copy link
Member Author

rebased, because #263 was merged

@kolyshkin
Copy link

exp CI failure is a flaky test

00:55:30.939 FAIL: docker_cli_run_test.go:1792: DockerSuite.TestRunInteractiveWithRestartPolicy

@andrewhsu andrewhsu modified the milestones: 18.09.7, 18.09.8 Jun 27, 2019
@thaJeztah thaJeztah modified the milestones: 18.09.8, 18.09.9 Jul 18, 2019
Copy link

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah force-pushed the 18.09_backport_attach_to_existing_network_error branch from 073ee4a to f11f583 Compare August 8, 2019 16:13
@thaJeztah
Copy link
Member Author

rebased to trigger CI

Arko Dasgupta added 2 commits August 27, 2019 23:57
retries to attach to a network, it is already connected to

Fixes - docker/for-linux#632

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
(cherry picked from commit 871acb1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
(cherry picked from commit 31e8fcc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 18.09_backport_attach_to_existing_network_error branch from f11f583 to a6a3d6c Compare August 27, 2019 21:57
@thaJeztah
Copy link
Member Author

rebased again to trigger CI

@thaJeztah thaJeztah modified the milestones: 18.09.9, 18.09.10 Aug 30, 2019
@andrewhsu andrewhsu merged commit c3e816c into docker:18.09 Sep 23, 2019
@thaJeztah thaJeztah deleted the 18.09_backport_attach_to_existing_network_error branch September 23, 2019 17:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants