Merge pull request #2411 from lemrouch/2410-fix

Macvlan network handles netlabel.Internal wrong
This commit is contained in:
elangovan sivanandam 2019-07-15 12:37:29 -04:00 committed by GitHub
commit 43b7bc99dc
2 changed files with 12 additions and 8 deletions

View File

@ -182,10 +182,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
}
}
// setting the parent to "" will trigger an isolated network dummy parent link
if _, ok := option[netlabel.Internal]; ok {
config.Internal = true
// empty --parent= and --internal are handled the same.
config.Parent = ""
if val, ok := option[netlabel.Internal]; ok {
if internal, ok := val.(bool); ok && internal {
config.Internal = true
// empty --parent= and --internal are handled the same.
config.Parent = ""
}
}
return config, nil
}

View File

@ -186,10 +186,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
}
}
// setting the parent to "" will trigger an isolated network dummy parent link
if _, ok := option[netlabel.Internal]; ok {
config.Internal = true
// empty --parent= and --internal are handled the same.
config.Parent = ""
if val, ok := option[netlabel.Internal]; ok {
if internal, ok := val.(bool); ok && internal {
config.Internal = true
// empty --parent= and --internal are handled the same.
config.Parent = ""
}
}
return config, nil