Skip to content

Commit 6a9500e

Browse files
authored
Merge pull request kubernetes#92940 from yuanchen8911/patch-2
Fix naming inconsistency in scheduler plugin interface comments
2 parents fe8aa6e + f6f9bf3 commit 6a9500e

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

pkg/scheduler/framework/v1alpha1/interface.go

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ const (
6363
// scheduler skip preemption.
6464
// The accompanying status message should explain why the pod is unschedulable.
6565
Unschedulable
66-
// UnschedulableAndUnresolvable is used when a (pre-)filter plugin finds a pod unschedulable and
66+
// UnschedulableAndUnresolvable is used when a PreFilter plugin finds a pod unschedulable and
6767
// preemption would not change anything. Plugins should return Unschedulable if it is possible
6868
// that the pod can get scheduled with preemption.
6969
// The accompanying status message should explain why the pod is unschedulable.
7070
UnschedulableAndUnresolvable
71-
// Wait is used when a permit plugin finds a pod scheduling should wait.
71+
// Wait is used when a Permit plugin finds a pod scheduling should wait.
7272
Wait
73-
// Skip is used when a bind plugin chooses to skip binding.
73+
// Skip is used when a Bind plugin chooses to skip binding.
7474
Skip
7575
)
7676

@@ -195,9 +195,9 @@ func (p PluginToStatus) Merge() *Status {
195195
type WaitingPod interface {
196196
// GetPod returns a reference to the waiting pod.
197197
GetPod() *v1.Pod
198-
// GetPendingPlugins returns a list of pending permit plugin's name.
198+
// GetPendingPlugins returns a list of pending Permit plugin's name.
199199
GetPendingPlugins() []string
200-
// Allow declares the waiting pod is allowed to be scheduled by plugin pluginName.
200+
// Allow declares the waiting pod is allowed to be scheduled by the plugin named as "pluginName".
201201
// If this is the last remaining plugin to allow, then a success signal is delivered
202202
// to unblock the pod.
203203
Allow(pluginName string)
@@ -234,7 +234,7 @@ type PreFilterExtensions interface {
234234
RemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *NodeInfo) *Status
235235
}
236236

237-
// PreFilterPlugin is an interface that must be implemented by "prefilter" plugins.
237+
// PreFilterPlugin is an interface that must be implemented by "PreFilter" plugins.
238238
// These plugins are called at the beginning of the scheduling cycle.
239239
type PreFilterPlugin interface {
240240
Plugin
@@ -273,7 +273,7 @@ type FilterPlugin interface {
273273
Filter(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo *NodeInfo) *Status
274274
}
275275

276-
// PostFilterPlugin is an interface for PostFilter plugins. These plugins are called
276+
// PostFilterPlugin is an interface for "PostFilter" plugins. These plugins are called
277277
// after a pod cannot be scheduled.
278278
type PostFilterPlugin interface {
279279
Plugin
@@ -290,7 +290,7 @@ type PostFilterPlugin interface {
290290
PostFilter(ctx context.Context, state *CycleState, pod *v1.Pod, filteredNodeStatusMap NodeToStatusMap) (*PostFilterResult, *Status)
291291
}
292292

293-
// PreScorePlugin is an interface for Pre-score plugin. Pre-score is an
293+
// PreScorePlugin is an interface for "PreScore" plugin. PreScore is an
294294
// informational extension point. Plugins will be called with a list of nodes
295295
// that passed the filtering phase. A plugin may use this data to update internal
296296
// state or to generate logs/metrics.
@@ -310,7 +310,7 @@ type ScoreExtensions interface {
310310
NormalizeScore(ctx context.Context, state *CycleState, p *v1.Pod, scores NodeScoreList) *Status
311311
}
312312

313-
// ScorePlugin is an interface that must be implemented by "score" plugins to rank
313+
// ScorePlugin is an interface that must be implemented by "Score" plugins to rank
314314
// nodes that passed the filtering phase.
315315
type ScorePlugin interface {
316316
Plugin
@@ -343,16 +343,16 @@ type ReservePlugin interface {
343343
Unreserve(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string)
344344
}
345345

346-
// PreBindPlugin is an interface that must be implemented by "prebind" plugins.
347-
// These plugins are called before a pod is bound.
346+
// PreBindPlugin is an interface that must be implemented by "PreBind" plugins.
347+
// These plugins are called before a pod being scheduled.
348348
type PreBindPlugin interface {
349349
Plugin
350350
// PreBind is called before binding a pod. All prebind plugins must return
351351
// success or the pod will be rejected and won't be sent for binding.
352352
PreBind(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) *Status
353353
}
354354

355-
// PostBindPlugin is an interface that must be implemented by "postbind" plugins.
355+
// PostBindPlugin is an interface that must be implemented by "PostBind" plugins.
356356
// These plugins are called after a pod is successfully bound to a node.
357357
type PostBindPlugin interface {
358358
Plugin
@@ -363,7 +363,7 @@ type PostBindPlugin interface {
363363
PostBind(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string)
364364
}
365365

366-
// PermitPlugin is an interface that must be implemented by "permit" plugins.
366+
// PermitPlugin is an interface that must be implemented by "Permit" plugins.
367367
// These plugins are called before a pod is bound to a node.
368368
type PermitPlugin interface {
369369
Plugin
@@ -376,7 +376,7 @@ type PermitPlugin interface {
376376
Permit(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) (*Status, time.Duration)
377377
}
378378

379-
// BindPlugin is an interface that must be implemented by "bind" plugins. Bind
379+
// BindPlugin is an interface that must be implemented by "Bind" plugins. Bind
380380
// plugins are used to bind a pod to a Node.
381381
type BindPlugin interface {
382382
Plugin
@@ -396,13 +396,13 @@ type Framework interface {
396396
// QueueSortFunc returns the function to sort pods in scheduling queue
397397
QueueSortFunc() LessFunc
398398

399-
// RunPreFilterPlugins runs the set of configured prefilter plugins. It returns
399+
// RunPreFilterPlugins runs the set of configured PreFilter plugins. It returns
400400
// *Status and its code is set to non-success if any of the plugins returns
401401
// anything but Success. If a non-success status is returned, then the scheduling
402402
// cycle is aborted.
403403
RunPreFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod) *Status
404404

405-
// RunFilterPlugins runs the set of configured filter plugins for pod on
405+
// RunFilterPlugins runs the set of configured Filter plugins for pod on
406406
// the given node. Note that for the node being evaluated, the passed nodeInfo
407407
// reference could be different from the one in NodeInfoSnapshot map (e.g., pods
408408
// considered to be running on the node could be different). For example, during
@@ -427,61 +427,61 @@ type Framework interface {
427427
// status other than Success.
428428
RunPreFilterExtensionRemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *NodeInfo) *Status
429429

430-
// RunPreScorePlugins runs the set of configured pre-score plugins. If any
430+
// RunPreScorePlugins runs the set of configured PreScore plugins. If any
431431
// of these plugins returns any status other than "Success", the given pod is rejected.
432432
RunPreScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []*v1.Node) *Status
433433

434-
// RunScorePlugins runs the set of configured scoring plugins. It returns a map that
435-
// stores for each scoring plugin name the corresponding NodeScoreList(s).
434+
// RunScorePlugins runs the set of configured Score plugins. It returns a map that
435+
// stores for each Score plugin name the corresponding NodeScoreList(s).
436436
// It also returns *Status, which is set to non-success if any of the plugins returns
437437
// a non-success status.
438438
RunScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []*v1.Node) (PluginToNodeScores, *Status)
439439

440-
// RunPreBindPlugins runs the set of configured prebind plugins. It returns
440+
// RunPreBindPlugins runs the set of configured PreBind plugins. It returns
441441
// *Status and its code is set to non-success if any of the plugins returns
442442
// anything but Success. If the Status code is "Unschedulable", it is
443443
// considered as a scheduling check failure, otherwise, it is considered as an
444444
// internal error. In either case the pod is not going to be bound.
445445
RunPreBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status
446446

447-
// RunPostBindPlugins runs the set of configured postbind plugins.
447+
// RunPostBindPlugins runs the set of configured PostBind plugins.
448448
RunPostBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string)
449449

450450
// RunReservePluginsReserve runs the Reserve method of the set of
451-
// configured reserve plugins. If any of these calls returns an error, it
451+
// configured Reserve plugins. If any of these calls returns an error, it
452452
// does not continue running the remaining ones and returns the error. In
453453
// such case, pod will not be scheduled.
454454
RunReservePluginsReserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status
455455

456456
// RunReservePluginsUnreserve runs the Unreserve method of the set of
457-
// configured reserve plugins.
457+
// configured Reserve plugins.
458458
RunReservePluginsUnreserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string)
459459

460-
// RunPermitPlugins runs the set of configured permit plugins. If any of these
460+
// RunPermitPlugins runs the set of configured Permit plugins. If any of these
461461
// plugins returns a status other than "Success" or "Wait", it does not continue
462462
// running the remaining plugins and returns an error. Otherwise, if any of the
463463
// plugins returns "Wait", then this function will create and add waiting pod
464464
// to a map of currently waiting pods and return status with "Wait" code.
465-
// Pod will remain waiting pod for the minimum duration returned by the permit plugins.
465+
// Pod will remain waiting pod for the minimum duration returned by the Permit plugins.
466466
RunPermitPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status
467467

468468
// WaitOnPermit will block, if the pod is a waiting pod, until the waiting pod is rejected or allowed.
469469
WaitOnPermit(ctx context.Context, pod *v1.Pod) *Status
470470

471-
// RunBindPlugins runs the set of configured bind plugins. A bind plugin may choose
472-
// whether or not to handle the given Pod. If a bind plugin chooses to skip the
471+
// RunBindPlugins runs the set of configured Bind plugins. A Bind plugin may choose
472+
// whether or not to handle the given Pod. If a Bind plugin chooses to skip the
473473
// binding, it should return code=5("skip") status. Otherwise, it should return "Error"
474474
// or "Success". If none of the plugins handled binding, RunBindPlugins returns
475475
// code=5("skip") status.
476476
RunBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status
477477

478-
// HasFilterPlugins returns true if at least one filter plugin is defined.
478+
// HasFilterPlugins returns true if at least one Filter plugin is defined.
479479
HasFilterPlugins() bool
480480

481-
// HasPostFilterPlugins returns true if at least one postFilter plugin is defined.
481+
// HasPostFilterPlugins returns true if at least one PostFilter plugin is defined.
482482
HasPostFilterPlugins() bool
483483

484-
// HasScorePlugins returns true if at least one score plugin is defined.
484+
// HasScorePlugins returns true if at least one Score plugin is defined.
485485
HasScorePlugins() bool
486486

487487
// ListPlugins returns a map of extension point name to list of configured Plugins.

0 commit comments

Comments
 (0)