Skip to content

Commit d834381

Browse files
committed
initial update to load plugins from file
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent 19748f3 commit d834381

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

cmd/epp/runner/runner.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,16 @@ func (r *Runner) Run(ctx context.Context) error {
264264
return err
265265
}
266266

267-
err = r.parseConfiguration(ctx)
267+
err = r.parsePluginsConfiguration(ctx)
268268
if err != nil {
269-
setupLog.Error(err, "Failed to parse the configuration")
269+
setupLog.Error(err, "Failed to parse plugins configuration")
270270
return err
271271
}
272272

273273
// --- Initialize Core EPP Components ---
274-
scheduler := r.initializeScheduler()
274+
scheduler := scheduling.NewSchedulerWithConfig(r.schedulerConfig)
275275

276-
saturationDetector := saturationdetector.NewDetector(sdConfig, datastore, ctrl.Log)
276+
saturationDetector := saturationdetector.NewDetector(sdConfig, datastore, setupLog)
277277

278278
director := requestcontrol.NewDirectorWithConfig(datastore, scheduler, saturationDetector, r.requestControlConfig)
279279

@@ -318,16 +318,7 @@ func (r *Runner) Run(ctx context.Context) error {
318318
return nil
319319
}
320320

321-
func (r *Runner) initializeScheduler() *scheduling.Scheduler {
322-
if r.schedulerConfig != nil {
323-
return scheduling.NewSchedulerWithConfig(r.schedulerConfig)
324-
}
325-
326-
// otherwise, no one configured from outside scheduler config. use existing configuration
327-
return scheduling.NewScheduler()
328-
}
329-
330-
func (r *Runner) parseConfiguration(ctx context.Context) error {
321+
func (r *Runner) parsePluginsConfiguration(ctx context.Context) error {
331322
if *configText == "" && *configFile == "" {
332323
return nil // configuring through code, not through file
333324
}

0 commit comments

Comments
 (0)