mirror of
https://github.com/rancher/os.git
synced 2025-09-19 09:22:40 +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:
@@ -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 {
|
||||
|
@@ -156,10 +156,10 @@ func (s *QemuSuite) NetCheckOutput(c *C, result string, check Checker, additiona
|
||||
func (s *QemuSuite) runQemu(c *C, args ...string) error {
|
||||
c.Assert(s.qemuCmd, IsNil) // can't run 2 qemu's at once (yet)
|
||||
s.qemuCmd = exec.Command(s.runCommand, args...)
|
||||
//if os.Getenv("DEBUG") != "" {
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
s.qemuCmd.Stdout = os.Stdout
|
||||
s.qemuCmd.Stderr = os.Stderr
|
||||
//}
|
||||
}
|
||||
if err := s.qemuCmd.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -260,11 +260,14 @@ sudo ros service stop network
|
||||
sleep 1
|
||||
sudo ros service start network
|
||||
sleep 1
|
||||
echo "==================="
|
||||
sudo system-docker logs network
|
||||
echo "==================="
|
||||
ip a
|
||||
`)
|
||||
|
||||
s.NetCheckOutput(c, version, Equals, "sudo ros -v")
|
||||
s.NetCheckOutput(c, "", Not(Equals), "sh", "-c", "ip a show eth1 2>/dev/null | grep 10.0.2.253")
|
||||
s.NetCheckOutput(c, "", Not(Equals), "sh", "-c", "\"ip a show eth1 | grep 10.0.2.253\"")
|
||||
s.Stop(c)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user