From b20bc79a602771578e342532789eed2fcb73f477 Mon Sep 17 00:00:00 2001 From: HirazawaUi <695097494plus@gmail.com> Date: Sun, 23 Jul 2023 22:08:13 +0800 Subject: [PATCH] remove not register event code --- .../plugins/dynamicresources/dynamicresources.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index e090129daaf..af52e97465e 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -302,16 +302,11 @@ func (pl *dynamicResources) PreEnqueue(ctx context.Context, pod *v1.Pod) (status return nil } -// isSchedulableAfterClaimChange is invoked for all claim events reported by +// isSchedulableAfterClaimChange is invoked for add and update claim events reported by // an informer. It checks whether that change made a previously unschedulable // pod schedulable. It errs on the side of letting a pod scheduling attempt -// happen. +// happen. The delete claim event will not invoke it, so newObj will never be nil. func (pl *dynamicResources) isSchedulableAfterClaimChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - if newObj == nil { - // Deletes don't make a pod schedulable. - return framework.QueueSkip, nil - } - originalClaim, modifiedClaim, err := schedutil.As[*resourcev1alpha2.ResourceClaim](oldObj, newObj) if err != nil { // Shouldn't happen.