mirror of
https://github.com/rancher/os.git
synced 2025-09-19 17:38:30 +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)
|
addrMap := make(map[string]bool)
|
||||||
for _, address := range addresses {
|
for _, address := range addresses {
|
||||||
addrMap[address] = true
|
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 {
|
for _, addr := range existingAddrs {
|
||||||
if _, ok := addrMap[addr.IPNet.String()]; !ok {
|
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?
|
// TODO: can we set to default?
|
||||||
if netConf.MTU > 0 {
|
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 {
|
func (s *QemuSuite) runQemu(c *C, args ...string) error {
|
||||||
c.Assert(s.qemuCmd, IsNil) // can't run 2 qemu's at once (yet)
|
c.Assert(s.qemuCmd, IsNil) // can't run 2 qemu's at once (yet)
|
||||||
s.qemuCmd = exec.Command(s.runCommand, args...)
|
s.qemuCmd = exec.Command(s.runCommand, args...)
|
||||||
//if os.Getenv("DEBUG") != "" {
|
if os.Getenv("DEBUG") != "" {
|
||||||
s.qemuCmd.Stdout = os.Stdout
|
s.qemuCmd.Stdout = os.Stdout
|
||||||
s.qemuCmd.Stderr = os.Stderr
|
s.qemuCmd.Stderr = os.Stderr
|
||||||
//}
|
}
|
||||||
if err := s.qemuCmd.Start(); err != nil {
|
if err := s.qemuCmd.Start(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@@ -165,10 +165,10 @@ func (s *QemuSuite) KillsMyServerTestInstalledDhcp(c *C) {
|
|||||||
runArgs := []string{
|
runArgs := []string{
|
||||||
"--iso",
|
"--iso",
|
||||||
"--fresh",
|
"--fresh",
|
||||||
// "-net", "nic,vlan=0,model=virtio",
|
// "-net", "nic,vlan=0,model=virtio",
|
||||||
// "-net", "user,vlan=0",
|
// "-net", "user,vlan=0",
|
||||||
// "-net", "nic,vlan=0,model=virtio",
|
// "-net", "nic,vlan=0,model=virtio",
|
||||||
// "-net", "user,vlan=0",
|
// "-net", "user,vlan=0",
|
||||||
}
|
}
|
||||||
version := ""
|
version := ""
|
||||||
{
|
{
|
||||||
@@ -260,11 +260,14 @@ sudo ros service stop network
|
|||||||
sleep 1
|
sleep 1
|
||||||
sudo ros service start network
|
sudo ros service start network
|
||||||
sleep 1
|
sleep 1
|
||||||
|
echo "==================="
|
||||||
|
sudo system-docker logs network
|
||||||
|
echo "==================="
|
||||||
ip a
|
ip a
|
||||||
`)
|
`)
|
||||||
|
|
||||||
s.NetCheckOutput(c, version, Equals, "sudo ros -v")
|
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)
|
s.Stop(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user