Skip to content

Commit 25a24a9

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

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
@@ -272,16 +272,16 @@ func (r *Runner) Run(ctx context.Context) error {
272272
}
273273
}
274274

275-
err = r.parseConfiguration(ctx)
275+
err = r.parsePluginsConfiguration(ctx)
276276
if err != nil {
277-
setupLog.Error(err, "Failed to parse the configuration")
277+
setupLog.Error(err, "Failed to parse plugins configuration")
278278
return err
279279
}
280280

281281
// --- Initialize Core EPP Components ---
282-
scheduler := r.initializeScheduler()
282+
scheduler := scheduling.NewSchedulerWithConfig(r.schedulerConfig)
283283

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

286286
director := requestcontrol.NewDirectorWithConfig(datastore, scheduler, saturationDetector, r.requestControlConfig)
287287

@@ -326,16 +326,7 @@ func (r *Runner) Run(ctx context.Context) error {
326326
return nil
327327
}
328328

329-
func (r *Runner) initializeScheduler() *scheduling.Scheduler {
330-
if r.schedulerConfig != nil {
331-
return scheduling.NewSchedulerWithConfig(r.schedulerConfig)
332-
}
333-
334-
// otherwise, no one configured from outside scheduler config. use existing configuration
335-
return scheduling.NewScheduler()
336-
}
337-
338-
func (r *Runner) parseConfiguration(ctx context.Context) error {
329+
func (r *Runner) parsePluginsConfiguration(ctx context.Context) error {
339330
if *configText == "" && *configFile == "" {
340331
return nil // configuring through code, not through file
341332
}

0 commit comments

Comments
 (0)