Skip to content

Commit

Permalink
fix(host): setup routes from start to end (#18675)
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi authored Nov 14, 2023
1 parent 421d903 commit d0e8ec1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions pkg/hostman/host_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package hostman

import (
"time"

execlient "yunion.io/x/executor/client"
"yunion.io/x/log"

Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/hostman/hostinfo/hostbridge/hostbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d0e8ec1

Please sign in to comment.