Skip to content

Commit

Permalink
enhancement: disable health checker in cloud mode (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrmagicE authored Sep 24, 2021
1 parent 7aa7917 commit 07c3409
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/yurthub/app/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,18 @@ func Run(cfg *config.YurtHubConfiguration, stopCh <-chan struct{}) error {
}
trace++

klog.Infof("%d. create health checker for remote servers ", trace)
healthChecker, err := healthchecker.NewHealthChecker(cfg, transportManager, stopCh)
if err != nil {
return fmt.Errorf("could not new health checker, %v", err)
var healthChecker healthchecker.HealthChecker
if cfg.WorkingMode == util.WorkingModeEdge {
klog.Infof("%d. create health checker for remote servers ", trace)
healthChecker, err = healthchecker.NewHealthChecker(cfg, transportManager, stopCh)
if err != nil {
return fmt.Errorf("could not new health checker, %v", err)
}
} else {
klog.Infof("%d. disable health checker for node %s because it is a cloud node", trace, cfg.NodeName)
// In cloud mode, health checker is not needed.
// This fake checker will always report that the remote server is healthy.
healthChecker = healthchecker.NewFakeChecker(true, make(map[string]int))
}
healthChecker.Run()
trace++
Expand Down

0 comments on commit 07c3409

Please sign in to comment.