Skip to content

Commit

Permalink
Prefer netplan over ENI when both exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
howbazaar authored and manadart committed May 13, 2020
1 parent 0b123a9 commit b821c31
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions container/broker/instance_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,13 @@ func prepareHost(config Config) PrepareHostFunc {
}
}

// defaultBridger will prefer to use netplan if there is an /etc/netplan
// directory, falling back to ENI if the directory doesn't exist.
func defaultBridger() (network.Bridger, error) {
if _, err := os.Stat(systemSbinIfup); err == nil {
return network.DefaultEtcNetworkInterfacesBridger(activateBridgesTimeout, systemNetworkInterfacesFile)
} else {
if _, err := os.Stat(systemNetplanDirectory); err == nil {
return network.DefaultNetplanBridger(activateBridgesTimeout, systemNetplanDirectory)
} else {
return network.DefaultEtcNetworkInterfacesBridger(activateBridgesTimeout, systemNetworkInterfacesFile)
}
}

Expand Down

0 comments on commit b821c31

Please sign in to comment.