diff --git a/libnetwork/config/config.go b/libnetwork/config/config.go index 122241896b..003ceb1114 100644 --- a/libnetwork/config/config.go +++ b/libnetwork/config/config.go @@ -34,9 +34,8 @@ type Config struct { PluginGetter plugingetter.PluginGetter } -// ParseConfigOptions parses the configuration options and returns -// a reference to the corresponding Config structure -func ParseConfigOptions(opts ...Option) *Config { +// New creates a new Config and initializes it with the given Options. +func New(opts ...Option) *Config { cfg := &Config{ DriverCfg: make(map[string]interface{}), Scopes: make(map[string]*datastore.ScopeCfg), diff --git a/libnetwork/controller.go b/libnetwork/controller.go index a09685f07c..2ad5726da1 100644 --- a/libnetwork/controller.go +++ b/libnetwork/controller.go @@ -186,7 +186,7 @@ type initializer struct { func New(cfgOptions ...config.Option) (NetworkController, error) { c := &controller{ id: stringid.GenerateRandomID(), - cfg: config.ParseConfigOptions(cfgOptions...), + cfg: config.New(cfgOptions...), sandboxes: sandboxTable{}, svcRecords: make(map[string]svcInfo), serviceBindings: make(map[serviceKey]*service), @@ -447,7 +447,7 @@ func (c *controller) ReloadConfiguration(cfgOptions ...config.Option) error { // For now we accept the configuration reload only as a mean to provide a global store config after boot. // Refuse the configuration if it alters an existing datastore client configuration. update := false - cfg := config.ParseConfigOptions(cfgOptions...) + cfg := config.New(cfgOptions...) for s := range c.cfg.Scopes { if _, ok := cfg.Scopes[s]; !ok {