-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: Implementation of enable_icc option #69
Conversation
f84d537
to
556f836
Compare
556f836
to
2f98c52
Compare
Approved with some comments, LGTM just a couple of nits and clarifying questions. |
f08b0c1
to
e3c3796
Compare
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.
Leave a few comments. Overall I am still concerned with potential race conditions, such as:
- concurrent network creates; or
- concurrent network create and remove.
Prior to this change nerdctl seems able to handle the races with locked dirs. However I don't think the protection could be extended to our iptable setup/teardowns.
Added a per-network mutex map to address some of the race concerns: 9fb2cf3. The idea is that for the same network name, multiple concurrent requests for Create/Removal will be thread safe since we keep a map of mutex per network name. Also, operations within the same Create/Request calls are now atomic as the lock is held until the operation completes. |
Signed-off-by: Swagat Bora <[email protected]>
Signed-off-by: Swagat Bora <[email protected]>
Signed-off-by: Swagat Bora <[email protected]>
Signed-off-by: Swagat Bora <[email protected]>
9fb2cf3
to
ca250ee
Compare
network. Signed-off-by: Swagat Bora <[email protected]>
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. Thanks
53137ab
Signed-off-by: Swagat Bora <[email protected]>
53137ab
to
ba979e7
Compare
Issue #, if available:
Description of changes:
Docker currently supports configuration of intercontainer connectivity between containers attached to the same network bridge. By default, it enables inter-connectivity. However, to disable this behavior, it supports a special network option during network create called
com.docker.network.bridge.enable_icc
. CNI also allows intra-bridge connectivity, but there is no option to configure that behavior,i.e, disable it.This PR adds support for the
com.docker.network.bridge.enable_icc
docker network option. Specially, it will handle the case when theenable_icc
is set to false, by adding iptable rules disabling traffic in and out of the same bridge.This PR also:
Removes filtering of "com.docker.network.bridge.enable_ip_masquerade" option since this is now being handled in nerdctl
Refactors the code for network create to separate out driver specific logic and help with testing
Testing done:
Steps to test locally:
License Acceptance
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.