Skip to content

Commit 4f86de7

Browse files
authored
Merge pull request #2411 from lemrouch/2410-fix
Macvlan network handles netlabel.Internal wrong
2 parents 14f9d75 + 15d891c commit 4f86de7

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

drivers/ipvlan/ipvlan_network.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
182182
}
183183
}
184184
// setting the parent to "" will trigger an isolated network dummy parent link
185-
if _, ok := option[netlabel.Internal]; ok {
186-
config.Internal = true
187-
// empty --parent= and --internal are handled the same.
188-
config.Parent = ""
185+
if val, ok := option[netlabel.Internal]; ok {
186+
if internal, ok := val.(bool); ok && internal {
187+
config.Internal = true
188+
// empty --parent= and --internal are handled the same.
189+
config.Parent = ""
190+
}
189191
}
190192
return config, nil
191193
}

drivers/macvlan/macvlan_network.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
186186
}
187187
}
188188
// setting the parent to "" will trigger an isolated network dummy parent link
189-
if _, ok := option[netlabel.Internal]; ok {
190-
config.Internal = true
191-
// empty --parent= and --internal are handled the same.
192-
config.Parent = ""
189+
if val, ok := option[netlabel.Internal]; ok {
190+
if internal, ok := val.(bool); ok && internal {
191+
config.Internal = true
192+
// empty --parent= and --internal are handled the same.
193+
config.Parent = ""
194+
}
193195
}
194196

195197
return config, nil

0 commit comments

Comments
 (0)