Skip to content

Commit 25d3ca9

Browse files
committed
Macvlan network handles netlabel.Internal wrong
check value of netlabel.Internal not just it's existence Signed-off-by: Pavel Matěja <pavel@verotel.cz>
1 parent b5e7180 commit 25d3ca9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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)