Skip to content

Conversation

@rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented May 28, 2018

Ⅰ. Describe what this PR did

Change the default nat bridge network from 172.17.0.1/24 to 192.168.5.1/24
Complete the bridge network configure.
Don't to change bridge device ip address.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang [email protected]

@rudyfly rudyfly changed the title feature: modify defaut bridge mode. [WIP]feature: modify defaut bridge mode. May 28, 2018
@rudyfly rudyfly changed the title [WIP]feature: modify defaut bridge mode. feature: modify defaut bridge mode. Jun 4, 2018
@rudyfly rudyfly requested review from Ace-Tang and allencloud June 4, 2018 08:42
@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #1424 into master will increase coverage by 0.02%.
The diff coverage is 59.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1424      +/-   ##
==========================================
+ Coverage   40.31%   40.34%   +0.02%     
==========================================
  Files         251      251              
  Lines       16416    16466      +50     
==========================================
+ Hits         6618     6643      +25     
- Misses       8956     8967      +11     
- Partials      842      856      +14
Impacted Files Coverage Δ
daemon/config/config.go 19.73% <100%> (ø) ⬆️
main.go 62.25% <100%> (+2.11%) ⬆️
daemon/daemon.go 56.25% <100%> (ø) ⬆️
network/mode/bridge/bridge.go 56.86% <46.77%> (-10.88%) ⬇️
daemon/mgr/network.go 69.43% <85.71%> (+0.64%) ⬆️
ctrd/watch.go 71.87% <0%> (-3.13%) ⬇️
daemon/logger/jsonfile/utils.go 70% <0%> (-1.67%) ⬇️
daemon/mgr/container.go 49.37% <0%> (+0.08%) ⬆️

@rudyfly rudyfly changed the title feature: modify defaut bridge mode. feature: modify defaut bridge mode Jun 4, 2018
return nil
}

//MergeConfigurations merges flagSet flags and config file flags into Config.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update this comment as well.

Copy link
Collaborator Author

@rudyfly rudyfly Jun 6, 2018

Choose a reason for hiding this comment

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

I think these comments is right 😄

}

if !types.CompareIPNet(addrv4.IPNet, config.AddressIPv4) {
if os.Getenv("SetBridgeIP") == "true" && !types.CompareIPNet(addrv4.IPNet, config.AddressIPv4) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change should add something into the document, right?
For this kind of work, the pouchd's source code relies on some outter specific environment variables. If no guidance is here, it is quite hard to software user to notice the usage of env. WDYT?
How to solve the problem for user is what we need to take into consideration. @rudyfly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will change it in my next job that vendor libnetwork into alibaba group.

// network config
flagSet.StringVar(&cfg.NetworkConfig.BridgeConfig.Name, "bridge-name", "", "Set default bridge name")
flagSet.StringVar(&cfg.NetworkConfig.BridgeConfig.IP, "bip", "", "Set bridge ip")
flagSet.StringVar(&cfg.NetworkConfig.BridgeConfig.GatewayIPv4, "default-gateway", "", "Set default bridge gateway")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Set IP address for default bridge gateway?

In addition, when we use IP in description or document, we must use IP with both letters uppercased. Please update the block of code.

MTU and CIDR as well.

Copy link
Collaborator Author

@rudyfly rudyfly Jun 6, 2018

Choose a reason for hiding this comment

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

Set IP address for default bridge gateway?

yes, it is bridge config, so set bridge ip address

In addition, when we use IP in description or document, we must use IP with both letters uppercased. Please update the block of code.

MTU and CIDR as well.

OK, I will modify

IP string `json:"bip"`
FixedCIDR string `json:"fixed-cidr"`
GatewayIPv4 string `json:"default-gateway"`
PreferredIP string `json:"preferred-ip"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is quite hard to understand this field without annotation.

Change the default nat bridge network from 172.17.0.1/24 to 192.168.5.1/24
Complete the bridge network configure.
Don't to change bridge device ip address.

Signed-off-by: Rudy Zhang <[email protected]>
@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jun 7, 2018
@allencloud allencloud merged commit 1ad6164 into AliyunContainerService:master Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants