1
0
mirror of https://github.com/rancher/os.git synced 2025-09-19 00:59:53 +00:00

Swap the remove and apply IP order - seem to fix the problem

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-06-13 12:11:53 +00:00
parent 3978d93fca
commit 75168c6d11
3 changed files with 21 additions and 16 deletions

View File

@@ -402,11 +402,6 @@ func applyInterfaceConfig(link netlink.Link, netConf InterfaceConfig) error {
addrMap := make(map[string]bool)
for _, address := range addresses {
addrMap[address] = true
log.Infof("Applying %s to %s", address, link.Attrs().Name)
err := applyAddress(address, link, netConf)
if err != nil {
log.Errorf("Failed to apply address %s to %s: %v", address, link.Attrs().Name, err)
}
}
for _, addr := range existingAddrs {
if _, ok := addrMap[addr.IPNet.String()]; !ok {
@@ -419,6 +414,13 @@ func applyInterfaceConfig(link netlink.Link, netConf InterfaceConfig) error {
}
}
}
for _, address := range addresses {
log.Infof("Applying %s to %s", address, link.Attrs().Name)
err := applyAddress(address, link, netConf)
if err != nil {
log.Errorf("Failed to apply address %s to %s: %v", address, link.Attrs().Name, err)
}
}
// TODO: can we set to default?
if netConf.MTU > 0 {