daemon: simplify networking config
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
91dc595e96
commit
e8e278c44f
3 changed files with 13 additions and 15 deletions
|
@ -1445,7 +1445,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()))
|
||||
|
|
|
@ -918,18 +918,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 {
|
||||
|
|
|
@ -517,8 +517,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