@@ -295,22 +295,26 @@ func (ext *frameworkExtenderImpl) RunPreFilterPlugins(ctx context.Context, cycle
295295 return nil , status
296296 }
297297 }
298+ nodeName , status := ext .RunFindOneNodePlugin (ctx , cycleState , pod , result )
299+ if status .IsSkip () {
300+ return result , nil
301+ }
302+ if ! status .IsSuccess () {
303+ status .SetFailedPlugin (ext .findOneNodePlugin .Name ())
304+ klog .ErrorS (status .AsError (), "Failed to run FindOneNodePlugin" , "pod" , klog .KObj (pod ), "plugin" , ext .findOneNodePlugin .Name ())
305+ return nil , status
306+ }
307+ return & framework.PreFilterResult {NodeNames : sets.New [string ](nodeName )}, nil
308+ }
309+
310+ func (ext * frameworkExtenderImpl ) RunFindOneNodePlugin (ctx context.Context , cycleState * framework.CycleState , pod * corev1.Pod , result * framework.PreFilterResult ) (string , * framework.Status ) {
298311 if ext .findOneNodePlugin != nil {
299312 startTime := time .Now ()
300313 nodeName , status := ext .findOneNodePlugin .FindOneNode (ctx , cycleState , pod , result )
301314 ext .metricsRecorder .ObservePluginDurationAsync ("FindOneNodePlugin" , ext .findOneNodePlugin .Name (), status .Code ().String (), metrics .SinceInSeconds (startTime ))
302- if status .IsSkip () {
303- return result , nil
304- }
305- if ! status .IsSuccess () {
306- status .SetFailedPlugin (ext .findOneNodePlugin .Name ())
307- klog .ErrorS (status .AsError (), "Failed to run FindOneNodePlugin" , "pod" , klog .KObj (pod ), "plugin" , ext .findOneNodePlugin .Name ())
308- return nil , status
309- }
310- return & framework.PreFilterResult {NodeNames : sets.New [string ](nodeName )}, nil
315+ return nodeName , status
311316 }
312-
313- return result , nil
317+ return "" , framework .NewStatus (framework .Skip )
314318}
315319
316320// RunFilterPluginsWithNominatedPods transforms the Filter phase of framework with filter transformers.
0 commit comments