mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Code refactor for readability
Signed-off-by: Kante Yin <kerthcet@gmail.com>
This commit is contained in:
parent
f7a9a9d5a9
commit
2ceadfe885
@ -730,14 +730,11 @@ func (f *frameworkImpl) RunFilterPlugins(
|
|||||||
pod *v1.Pod,
|
pod *v1.Pod,
|
||||||
nodeInfo *framework.NodeInfo,
|
nodeInfo *framework.NodeInfo,
|
||||||
) *framework.Status {
|
) *framework.Status {
|
||||||
var status *framework.Status
|
|
||||||
|
|
||||||
for _, pl := range f.filterPlugins {
|
for _, pl := range f.filterPlugins {
|
||||||
if state.SkipFilterPlugins.Has(pl.Name()) {
|
if state.SkipFilterPlugins.Has(pl.Name()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
status = f.runFilterPlugin(ctx, pl, state, pod, nodeInfo)
|
if status := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo); !status.IsSuccess() {
|
||||||
if !status.IsSuccess() {
|
|
||||||
if !status.IsUnschedulable() {
|
if !status.IsUnschedulable() {
|
||||||
// Filter plugins are not supposed to return any status other than
|
// Filter plugins are not supposed to return any status other than
|
||||||
// Success or Unschedulable.
|
// Success or Unschedulable.
|
||||||
@ -748,7 +745,7 @@ func (f *frameworkImpl) RunFilterPlugins(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *frameworkImpl) runFilterPlugin(ctx context.Context, pl framework.FilterPlugin, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
|
func (f *frameworkImpl) runFilterPlugin(ctx context.Context, pl framework.FilterPlugin, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
|
||||||
|
Loading…
Reference in New Issue
Block a user