mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-16 06:57:44 +08:00
fix(host): setup routes from start to end (#18674)
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
package hostman
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
execlient "yunion.io/x/executor/client"
|
||||
"yunion.io/x/log"
|
||||
|
||||
@@ -79,12 +77,7 @@ func (host *SHostService) RunService() {
|
||||
|
||||
hostInstance := hostinfo.Instance()
|
||||
if err := hostInstance.Init(); err != nil {
|
||||
log.Errorf("Host instance init error: %v", err)
|
||||
for {
|
||||
// to catch error
|
||||
time.Sleep(10 * time.Second)
|
||||
}
|
||||
// log.Fatalf("Host instance init error: %v", err)
|
||||
log.Fatalf("Host instance init error: %v", err)
|
||||
}
|
||||
|
||||
app_common.InitAuth(&options.HostOptions.CommonOptions, func() {
|
||||
|
||||
@@ -273,7 +273,7 @@ func (d *SBaseBridgeDriver) SetupRoutes(routespecs []iproute2.RouteSpec) error {
|
||||
bridgeIP := d.inter.Addr
|
||||
bridgeMask := d.inter.Mask
|
||||
br := d.bridge.String()
|
||||
for i := len(routespecs) - 1; i >= 0; i-- {
|
||||
for i := 0; i < len(routespecs); i++ {
|
||||
errs := []error{}
|
||||
routespec := routespecs[i]
|
||||
if routespec.Dst.Contains(net.ParseIP(bridgeIP)) && bridgeMask.String() == routespec.Dst.Mask.String() {
|
||||
|
||||
Reference in New Issue
Block a user