mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
libnetwork/config: rename ParseConfigOptions() to New()
This function effectively is a constructor, so rename it to better describe it's functionality. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
09cc2f9d0e
commit
267108e113
2 changed files with 4 additions and 5 deletions
|
@ -34,9 +34,8 @@ type Config struct {
|
||||||
PluginGetter plugingetter.PluginGetter
|
PluginGetter plugingetter.PluginGetter
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseConfigOptions parses the configuration options and returns
|
// New creates a new Config and initializes it with the given Options.
|
||||||
// a reference to the corresponding Config structure
|
func New(opts ...Option) *Config {
|
||||||
func ParseConfigOptions(opts ...Option) *Config {
|
|
||||||
cfg := &Config{
|
cfg := &Config{
|
||||||
DriverCfg: make(map[string]interface{}),
|
DriverCfg: make(map[string]interface{}),
|
||||||
Scopes: make(map[string]*datastore.ScopeCfg),
|
Scopes: make(map[string]*datastore.ScopeCfg),
|
||||||
|
|
|
@ -186,7 +186,7 @@ type initializer struct {
|
||||||
func New(cfgOptions ...config.Option) (NetworkController, error) {
|
func New(cfgOptions ...config.Option) (NetworkController, error) {
|
||||||
c := &controller{
|
c := &controller{
|
||||||
id: stringid.GenerateRandomID(),
|
id: stringid.GenerateRandomID(),
|
||||||
cfg: config.ParseConfigOptions(cfgOptions...),
|
cfg: config.New(cfgOptions...),
|
||||||
sandboxes: sandboxTable{},
|
sandboxes: sandboxTable{},
|
||||||
svcRecords: make(map[string]svcInfo),
|
svcRecords: make(map[string]svcInfo),
|
||||||
serviceBindings: make(map[serviceKey]*service),
|
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.
|
// 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.
|
// Refuse the configuration if it alters an existing datastore client configuration.
|
||||||
update := false
|
update := false
|
||||||
cfg := config.ParseConfigOptions(cfgOptions...)
|
cfg := config.New(cfgOptions...)
|
||||||
|
|
||||||
for s := range c.cfg.Scopes {
|
for s := range c.cfg.Scopes {
|
||||||
if _, ok := cfg.Scopes[s]; !ok {
|
if _, ok := cfg.Scopes[s]; !ok {
|
||||||
|
|
Loading…
Add table
Reference in a new issue