From e3bb82e323306274f056ba99f8ebfbc659d0df2b Mon Sep 17 00:00:00 2001 From: Matt Oswalt Date: Sun, 3 Feb 2019 11:30:54 -0800 Subject: [PATCH] Re-enable scheduler Signed-off-by: Matt Oswalt --- cmd/syringed/main.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cmd/syringed/main.go b/cmd/syringed/main.go index a38bc8a1..fcf036ef 100644 --- a/cmd/syringed/main.go +++ b/cmd/syringed/main.go @@ -13,6 +13,7 @@ import ( config "github.com/nre-learning/syringe/config" "github.com/nre-learning/syringe/scheduler" log "github.com/sirupsen/logrus" + "k8s.io/client-go/rest" ) func init() { @@ -28,10 +29,10 @@ func main() { log.Fatalf("Invalid configuration. Please re-run Syringe with appropriate env variables") } - // kubeConfig, err := rest.InClusterConfig() - // if err != nil { - // log.Fatal(err) - // } + kubeConfig, err := rest.InClusterConfig() + if err != nil { + log.Fatal(err) + } lessonDefs, err := api.ImportLessonDefs(syringeConfig, syringeConfig.LessonsDir) if err != nil { @@ -40,7 +41,7 @@ func main() { // Start lesson scheduler lessonScheduler := scheduler.LessonScheduler{ - // KubeConfig: kubeConfig, + KubeConfig: kubeConfig, Requests: make(chan *scheduler.LessonScheduleRequest), Results: make(chan *scheduler.LessonScheduleResult), LessonDefs: lessonDefs, @@ -48,12 +49,12 @@ func main() { GcWhiteList: make(map[string]*pb.Session), GcWhiteListMu: &sync.Mutex{}, } - // go func() { - // err = lessonScheduler.Start() - // if err != nil { - // log.Fatalf("Problem starting lesson scheduler: %s", err) - // } - // }() + go func() { + err = lessonScheduler.Start() + if err != nil { + log.Fatalf("Problem starting lesson scheduler: %s", err) + } + }() antidoteSha, err := ioutil.ReadFile(fmt.Sprintf("%s/.git/refs/heads/%s", syringeConfig.LessonRepoDir, syringeConfig.LessonRepoBranch)) if err != nil {