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 <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Dec 8, 2024
1 parent 29f411e commit 77424b4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 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
podGroupGVK := fmt.Sprintf("podgroups.v1alpha1.%v", scheduling.GroupName)
// https://github.com/kubernetes/kubernetes/pull/101394
// Please follow: eventhandlers.go#L403-L410
pgGVK := 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}},
}
{Event: framework.ClusterEvent{Resource: framework.GVK(pgGVK), ActionType: framework.Add | framework.Update}},
}, nil
}

// TODO we need to account for affinity here
Expand Down

0 comments on commit 77424b4

Please sign in to comment.