Skip to content

Commit e3484e3

Browse files
committed
adatp to framework.ClusterEventWithHint
1 parent 3174f72 commit e3484e3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

pkg/capacityscheduling/capacity_scheduling.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
191191
return c, nil
192192
}
193193

194-
func (c *CapacityScheduling) EventsToRegister() []framework.ClusterEvent {
194+
func (c *CapacityScheduling) EventsToRegister() []framework.ClusterEventWithHint {
195195
// To register a custom event, follow the naming convention at:
196196
// https://git.k8s.io/kubernetes/pkg/scheduler/eventhandlers.go#L403-L410
197197
eqGVK := fmt.Sprintf("elasticquotas.v1alpha1.%v", scheduling.GroupName)
198-
return []framework.ClusterEvent{
199-
{Resource: framework.Pod, ActionType: framework.Delete},
200-
{Resource: framework.GVK(eqGVK), ActionType: framework.All},
198+
return []framework.ClusterEventWithHint{
199+
{Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Delete}},
200+
{Event: framework.ClusterEvent{Resource: framework.GVK(eqGVK), ActionType: framework.All}},
201201
}
202202
}
203203

pkg/coscheduling/coscheduling.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
102102
return plugin, nil
103103
}
104104

105-
func (cs *Coscheduling) EventsToRegister() []framework.ClusterEvent {
105+
func (cs *Coscheduling) EventsToRegister() []framework.ClusterEventWithHint {
106106
// To register a custom event, follow the naming convention at:
107107
// https://git.k8s.io/kubernetes/pkg/scheduler/eventhandlers.go#L403-L410
108108
pgGVK := fmt.Sprintf("podgroups.v1alpha1.%v", scheduling.GroupName)
109-
return []framework.ClusterEvent{
110-
{Resource: framework.Pod, ActionType: framework.Add},
111-
{Resource: framework.GVK(pgGVK), ActionType: framework.Add | framework.Update},
109+
return []framework.ClusterEventWithHint{
110+
{Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Add}},
111+
{Event: framework.ClusterEvent{Resource: framework.GVK(pgGVK), ActionType: framework.Add | framework.Update}},
112112
}
113113
}
114114

pkg/noderesourcetopology/plugin.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error)
163163
// NOTE: if in-place-update (KEP 1287) gets implemented, then PodUpdate event
164164
// should be registered for this plugin since a Pod update may free up resources
165165
// that make other Pods schedulable.
166-
func (tm *TopologyMatch) EventsToRegister() []framework.ClusterEvent {
166+
func (tm *TopologyMatch) EventsToRegister() []framework.ClusterEventWithHint {
167167
// To register a custom event, follow the naming convention at:
168168
// https://git.k8s.io/kubernetes/pkg/scheduler/eventhandlers.go#L403-L410
169169
nrtGVK := fmt.Sprintf("noderesourcetopologies.v1alpha2.%v", topologyapi.GroupName)
170-
return []framework.ClusterEvent{
171-
{Resource: framework.Pod, ActionType: framework.Delete},
172-
{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeAllocatable},
173-
{Resource: framework.GVK(nrtGVK), ActionType: framework.Add | framework.Update},
170+
return []framework.ClusterEventWithHint{
171+
{Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Delete}},
172+
{Event: framework.ClusterEvent{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeAllocatable}},
173+
{Event: framework.ClusterEvent{Resource: framework.GVK(nrtGVK), ActionType: framework.Add | framework.Update}},
174174
}
175175
}

0 commit comments

Comments
 (0)