diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index 4a80409f..6a52bb64 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -141,7 +141,9 @@ func (s *Scheduler) RegisterFromNodeAnnotatons() error { klog.Errorln("nodes list failed", err.Error()) return err } + nodeNames := []string{} for _, val := range nodes { + nodeNames = append(nodeNames, val.Name) for devhandsk, devreg := range device.KnownDevice { _, ok := val.Annotations[devreg] if !ok { @@ -229,6 +231,11 @@ func (s *Scheduler) RegisterFromNodeAnnotatons() error { } } } + _, _, err = s.getNodesUsage(&nodeNames, nil) + if err != nil { + klog.Errorln("get node usage failed", err.Error()) + return err + } time.Sleep(time.Second * 15) } }