-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: enable ipv6 networking #2417
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2417 +/- ##
==========================================
- Coverage 68.97% 68.79% -0.19%
==========================================
Files 277 277
Lines 18298 18330 +32
==========================================
- Hits 12621 12610 -11
- Misses 4253 4281 +28
- Partials 1424 1439 +15
|
Is it OK to add some test of this? @houstar |
@allencloud OK. I"m working in progress with ipv6 testcases. |
Done with the IPv6 validation. Welcome to raise any comments. |
network/mode/bridge/bridge.go
Outdated
} | ||
|
||
ipam := &types.IPAM{ | ||
Driver: "default", | ||
Config: []types.IPAMConfig{ipamV4Conf}, | ||
} | ||
|
||
if config.IPv6 { |
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.
I think if we support ipv6, we should modify common function, instead of this way:
if ipv6 {
......
} else {
......
}
WDYT?
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.
Updated according to your comments :-)
@@ -206,7 +206,7 @@ func (h *Handle) getCopy() *Handle { | |||
|
|||
// SetAnyInRange atomically sets the first unset bit in the specified range in the sequence and returns the corresponding ordinal | |||
func (h *Handle) SetAnyInRange(start, end uint64, serial bool) (uint64, error) { | |||
if end < start || end >= h.bits { | |||
if end < start || end > h.bits { |
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.
Have you update the vendor libnetwork
?
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.
We have vendored the libnetwork is the alibaba libnetwork
, you can see: https://github.com/alibaba/libnetwork, if you want to modify it, you can send PR to our
libnetwork`
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.
Done. please help to merge. thanks.
|
||
// init host bridge network. | ||
_, err = initBridgeDevice(bridgeName, ipNet) | ||
_, err = initBridgeDevice(bridgeName, ipv4Net) |
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.
bridge device should support ipv6
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.
Bridge device already supported IPv6 since it deferred the IPv6 allocation by libnetwork IPAM module. So I think that there is no need to add assign bridge IPv6 address in here. WDYT ?
Intergration-test might be blocked by other test suite. So I'll work on the integration-test if upstream integration-test is ready.
Currently could you help to merge the PR to alibaba/libnetwork firstly? then I can vendor the new commit to build the integration-test.
For the failure of the upstream pouch integration-test. I also Cc'ed @allencloud
Steps:
$mkdir -p $GOPATH/src/github.com/alibaba && git clone https://github.com/alibaba/pouch
$cd $GOPATH/src/github.com/alibaba/pouch && make build-integration-test
$make integration-test
integration-test
./hack/testing/run_daemon_integration.sh
stop local-persist volume plugin...
start local-persist volume plugin...
stop pouch daemon...
start pouch daemon...
failed to start pouch daemon in background!
make: *** [integration-test] Error 1
Could you add integration test for ipv6? and rebase and merge your commits? |
OK. I will cover these integration test.
Is it rebase and merge above commits into one commit ? |
@houstar Is it rebase and merge above commits into one commit ?
|
Modified as your recommendation. Thanks for your carefully review /assign |
@rudyfly Done with the network integration-test, could you help review and merge ?
|
@rudyfly Any new comments? |
network/config.go
Outdated
GatewayIPv4 string `json:"default-gateway,omitempty"` | ||
IPv6 bool `json:"ipv6,omitempty"` |
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.
s/IPv6/EnableIPv6
and also change it in json format
WDYT?
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.
OK. got it
5bd661d
to
33df349
Compare
@houstar I'm sorry to late to review this pr, because of kubecon. |
Signed-off-by: Leno Hou <lenohou@gmail.com>
* add ipv6 and fixed-cidr-v6 Daemon flag * add IPv6 validation and integration test Signed-off-by: Leno Hou <lenohou@gmail.com>
33df349
to
c2f8e75
Compare
@rudyfly Take it easy, man . ~~~~ . :~) |
LGTM |
Ⅰ. Describe what this PR did
ipv6
andfixed-cidr-v6
into BridgeConfigipv6
andfixed-cidr-v6
into DaemonConfigⅡ. Does this pull request fix one issue?
fixes #2415
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
These two commits already included the integration test cases
Ⅳ. Describe how to verify it
[root@qing-for-dev$ ]pouchd --ipv6 true --debug
Ⅴ. Special notes for reviews
There is issue with vendor package `github.com/docker/libnetwork' when assign IPv6 address: