From 363f1d8c8aa2c43e3e1ed98a040825e8a7579f75 Mon Sep 17 00:00:00 2001 From: vsoch Date: Sat, 7 Dec 2024 18:45:27 -0700 Subject: [PATCH] bug: context missing from EventsToRegister Problem: the custom scheduler plugin interface now requires a context variable (which is empty/not used) Solution: add context.Context for it. Signed-off-by: vsoch --- sig-scheduler-plugins/pkg/fluence/fluence.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sig-scheduler-plugins/pkg/fluence/fluence.go b/sig-scheduler-plugins/pkg/fluence/fluence.go index 44f0349..166d770 100644 --- a/sig-scheduler-plugins/pkg/fluence/fluence.go +++ b/sig-scheduler-plugins/pkg/fluence/fluence.go @@ -140,14 +140,15 @@ func (fluence *Fluence) Name() string { // Fluence has added delete, although I wonder if update includes that signal // and it's redundant? -func (fluence *Fluence) EventsToRegister() []framework.ClusterEventWithHint { +func (fluence *Fluence) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error) { // To register a custom event, follow the naming convention at: - // https://git.k8s.io/kubernetes/pkg/scheduler/eventhandlers.go#L403-L410 + // https://github.com/kubernetes/kubernetes/pull/101394 + // Please follow: eventhandlers.go#L403-L410 podGroupGVK := fmt.Sprintf("podgroups.v1alpha1.%v", scheduling.GroupName) return []framework.ClusterEventWithHint{ {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Add | framework.Delete}}, {Event: framework.ClusterEvent{Resource: framework.GVK(podGroupGVK), ActionType: framework.Add | framework.Update | framework.Delete}}, - } + }, nil } // TODO we need to account for affinity here