mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #42726 from thaJeztah/daemon_simplify_nwconfig
daemon: simplify networking config
This commit is contained in:
commit
d116e12c6d
3 changed files with 13 additions and 15 deletions
|
@ -1450,7 +1450,7 @@ func (daemon *Daemon) networkOptions(dconfig *config.Config, pg plugingetter.Plu
|
|||
}
|
||||
|
||||
options = append(options, nwconfig.OptionLabels(dconfig.Labels))
|
||||
options = append(options, driverOptions(dconfig)...)
|
||||
options = append(options, driverOptions(dconfig))
|
||||
|
||||
if len(dconfig.NetworkConfig.DefaultAddressPools.Value()) > 0 {
|
||||
options = append(options, nwconfig.OptionDefaultAddressPoolConfig(dconfig.NetworkConfig.DefaultAddressPools.Value()))
|
||||
|
|
|
@ -921,18 +921,16 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox
|
|||
return controller, nil
|
||||
}
|
||||
|
||||
func driverOptions(config *config.Config) []nwconfig.Option {
|
||||
bridgeConfig := options.Generic{
|
||||
"EnableIPForwarding": config.BridgeConfig.EnableIPForward,
|
||||
"EnableIPTables": config.BridgeConfig.EnableIPTables,
|
||||
"EnableIP6Tables": config.BridgeConfig.EnableIP6Tables,
|
||||
"EnableUserlandProxy": config.BridgeConfig.EnableUserlandProxy,
|
||||
"UserlandProxyPath": config.BridgeConfig.UserlandProxyPath}
|
||||
bridgeOption := options.Generic{netlabel.GenericData: bridgeConfig}
|
||||
|
||||
dOptions := []nwconfig.Option{}
|
||||
dOptions = append(dOptions, nwconfig.OptionDriverConfig("bridge", bridgeOption))
|
||||
return dOptions
|
||||
func driverOptions(config *config.Config) nwconfig.Option {
|
||||
return nwconfig.OptionDriverConfig("bridge", options.Generic{
|
||||
netlabel.GenericData: options.Generic{
|
||||
"EnableIPForwarding": config.BridgeConfig.EnableIPForward,
|
||||
"EnableIPTables": config.BridgeConfig.EnableIPTables,
|
||||
"EnableIP6Tables": config.BridgeConfig.EnableIP6Tables,
|
||||
"EnableUserlandProxy": config.BridgeConfig.EnableUserlandProxy,
|
||||
"UserlandProxyPath": config.BridgeConfig.UserlandProxyPath,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func initBridgeDriver(controller libnetwork.NetworkController, config *config.Config) error {
|
||||
|
|
|
@ -522,8 +522,8 @@ func (daemon *Daemon) conditionalUnmountOnCleanup(container *container.Container
|
|||
return daemon.Unmount(container)
|
||||
}
|
||||
|
||||
func driverOptions(config *config.Config) []nwconfig.Option {
|
||||
return []nwconfig.Option{}
|
||||
func driverOptions(_ *config.Config) nwconfig.Option {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) stats(c *container.Container) (*types.StatsJSON, error) {
|
||||
|
|
Loading…
Reference in a new issue