Skip to content

Commit

Permalink
bug: context missing from EventsToRegister
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vsoch committed Dec 8, 2024
1 parent 29f411e commit 363f1d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sig-scheduler-plugins/pkg/fluence/fluence.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 363f1d8

Please sign in to comment.