Skip to content

Commit a6b77b4

Browse files
nirrozenbaumkfswain
authored andcommitted
added graceful shutdown when scheduler config is not initialized (kubernetes-sigs#1198)
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent cf0477d commit a6b77b4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/epp/runner/runner.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package runner
1919
import (
2020
"context"
2121
"crypto/tls"
22+
"errors"
2223
"flag"
2324
"fmt"
2425
"net/http"
@@ -304,6 +305,11 @@ func (r *Runner) Run(ctx context.Context) error {
304305
}
305306

306307
// --- Initialize Core EPP Components ---
308+
if r.schedulerConfig == nil {
309+
err := errors.New("scheduler config must be set either by config api or through code")
310+
setupLog.Error(err, "failed to create scheduler")
311+
return err
312+
}
307313
scheduler := scheduling.NewSchedulerWithConfig(r.schedulerConfig)
308314

309315
saturationDetector := saturationdetector.NewDetector(sdConfig, datastore, setupLog)

0 commit comments

Comments
 (0)