Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–209 unchanged (209 lines)
210 if !status.IsSuccess() {
211 return assumedPodInfo, status
212 }
213 assumedPod := assumedPodInfo.Pod
214
215 // Run "permit" plugins.
216 runPermitStatus := schedFramework.RunPermitPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost)
217 if !runPermitStatus.IsWait() && !runPermitStatus.IsSuccess() {
218 // trigger un-reserve plugins to clean up state associated with the reserved Pod
219 err := sched.unreserveAndForget(ctx, state, schedFramework, assumedPodInfo, scheduleResult.SuggestedHost)
220 if err != nil {
221 utilruntime.HandleErrorWithContext(ctx, err, "ForgetPod failed")
222 }
223
224 if runPermitStatus.IsRejected() {
225 fitErr := &framework.FitError{
226 NumAllNodes: 1,
227 Pod: podInfo.Pod,
228 Diagnosis: framework.Diagnosis{
229 NodeToStatus: framework.NewDefaultNodeToStatus(),
230 },
231 }
232 fitErr.Diagnosis.NodeToStatus.Set(scheduleResult.SuggestedHost, runPermitStatus)
233 fitErr.Diagnosis.AddPluginStatus(runPermitStatus)
234 return assumedPodInfo, fwk.NewStatus(runPermitStatus.Code()).WithError(fitErr)
235 }
236
237 return assumedPodInfo, runPermitStatus
238 }
239
240 // At the end of a successful scheduling cycle, pop and move up Pods if needed.
241 if len(podsToActivate.Map) != 0 {
242 logger := klog.FromContext(ctx)
243 sched.SchedulingQueue.Activate(logger, podsToActivate.Map)
244 // Clear the entries after activation.
…lines 245–1315 unchanged (1071 lines)

After

…lines 1–209 unchanged (209 lines)
210 if !status.IsSuccess() {
211 return assumedPodInfo, status
212 }
213 assumedPod := assumedPodInfo.Pod
214
215 // Run "permit" plugins.
216 pluginsWaitTime, runPermitStatus := schedFramework.RunPermitPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost)
217 if runPermitStatus.IsWait() {
218 schedFramework.AddWaitingPod(assumedPod, pluginsWaitTime)
219 } else if !runPermitStatus.IsSuccess() {
220 // trigger un-reserve plugins to clean up state associated with the reserved Pod
221 err := sched.unreserveAndForget(ctx, state, schedFramework, assumedPodInfo, scheduleResult.SuggestedHost)
222 if err != nil {
223 utilruntime.HandleErrorWithContext(ctx, err, "ForgetPod failed")
224 }
225
226 if runPermitStatus.IsRejected() {
227 fitErr := &framework.FitError{
228 NumAllNodes: 1,
229 Pod: podInfo.Pod,
230 Diagnosis: framework.Diagnosis{
231 NodeToStatus: framework.NewDefaultNodeToStatus(),
232 },
233 }
234 fitErr.Diagnosis.NodeToStatus.Set(scheduleResult.SuggestedHost, runPermitStatus)
235 fitErr.Diagnosis.AddPluginStatus(runPermitStatus)
236 return assumedPodInfo, fwk.NewStatus(runPermitStatus.Code()).WithError(fitErr)
237 }
238
239 return assumedPodInfo, runPermitStatus
240 }
241
242 // At the end of a successful scheduling cycle, pop and move up Pods if needed.
243 if len(podsToActivate.Map) != 0 {
244 logger := klog.FromContext(ctx)
245 sched.SchedulingQueue.Activate(logger, podsToActivate.Map)
246 // Clear the entries after activation.
…lines 247–1317 unchanged (1071 lines)

Before

source_file
comment "/*\nCopyright 2014 The Kubernetes Authors.\n\nLicensed under th"...
package_clause
package "package"
package_identifier "scheduler"
import_declaration (+144 nodes collapsed)
const_declaration (+28 nodes collapsed)
comment "// ScheduleOne does the entire scheduling workflow for a sin"...
comment "// It is serialized on the scheduling algorithm's host fitti"...
method_declaration (+284 nodes collapsed)
comment "// scheduleOnePod does the entire scheduling workflow for a "...
method_declaration (+471 nodes collapsed)
comment "// runBindingCycle runs a binding cycle algorithm."
method_declaration (+203 nodes collapsed)
var_declaration (+34 nodes collapsed)
comment "// schedulingCycle tries to schedule a single Pod."
method_declaration (+268 nodes collapsed)
comment "// prepareForBindingCycle applies the schedule result, gener"...
comment "// preparing for a binding cycle."
method_declaration
func "func"
parameter_list
( "("
parameter_declaration
identifier "sched"
pointer_type
* "*"
type_identifier "Scheduler"
) ")"
field_identifier "prepareForBindingCycle"
parameter_list (+46 nodes collapsed)
parameter_list
( "("
parameter_declaration
pointer_type
* "*"
qualified_type
package_identifier "framework"
. "."
type_identifier "QueuedPodInfo"
, ","
parameter_declaration
pointer_type
* "*"
qualified_type
package_identifier "fwk"
. "."
type_identifier "Status"
) ")"
block
{ "{"
statement_list
short_var_declaration (+24 nodes collapsed)
if_statement (+22 nodes collapsed)
short_var_declaration
expression_list
identifier "assumedPod"
:= ":="
expression_list
selector_expression
identifier "assumedPodInfo"
. "."
field_identifier "Pod"
comment "// Run \"permit\" plugins."
short_var_declaration
expression_list
identifier "runPermitStatus"
:= ":="
expression_list
call_expression
selector_expression
identifier "schedFramework"
. "."
field_identifier "RunPermitPlugins"
argument_list
( "("
identifier "ctx"
, ","
identifier "state"
, ","
identifier "assumedPod"
, ","
selector_expression
identifier "scheduleResult"
. "."
field_identifier "SuggestedHost"
) ")"
if_statement
if "if"
binary_expression
unary_expression
! "!"
call_expression
selector_expression
identifier "runPermitStatus"
. "."
field_identifier "IsWait"
argument_list
( "("
) ")"
&& "&&"
unary_expression
! "!"
call_expression
selector_expression
identifier "runPermitStatus"
. "."
field_identifier "IsSuccess"
argument_list
( "("
) ")"
block (+200 nodes collapsed)
comment "// At the end of a successful scheduling cycle, pop and move"...
if_statement (+75 nodes collapsed)
return_statement
return "return"
expression_list
identifier "assumedPodInfo"
, ","
nil "nil"
} "}"
comment "// schedulingAlgorithm runs fitering and scoring phases for "...
comment "// together with post filter when the pod is unschedulable."
method_declaration (+598 nodes collapsed)
comment "// assumeAndReserve assumes and reserves the pod in schedule"...
method_declaration (+402 nodes collapsed)
comment "// unreserveAndForget unreserves and forgets the pod from sc"...
comment "// This function shouldn't be called during binding cycle wi"...
comment "// but this shouldn't happen, because such pods cannot reach"...
method_declaration (+254 nodes collapsed)
comment "// bindingCycle tries to bind an assumed Pod."
method_declaration (+1065 nodes collapsed)
method_declaration (+273 nodes collapsed)
method_declaration (+98 nodes collapsed)
comment "// skipPodSchedule returns true if we could skip scheduling "...
method_declaration (+224 nodes collapsed)
comment "// schedulePod tries to schedule the given pod to one of the"...
comment "// If it succeeds, it will return the name of the node."
comment "// If it fails, it will return a FitError with reasons."
method_declaration (+612 nodes collapsed)
comment "// Filters the nodes to find the ones that fit the pod based"...
comment "// filter plugins and filter extenders."
method_declaration (+962 nodes collapsed)
method_declaration (+253 nodes collapsed)
comment "// hasScoring checks if scoring nodes is configured."
method_declaration (+82 nodes collapsed)
comment "// hasExtenderFilters checks if any extenders filter nodes."
method_declaration (+58 nodes collapsed)
comment "// findNodesThatPassFilters finds the nodes that fit the fil"...
method_declaration (+830 nodes collapsed)
comment "// numFeasibleNodesToFind returns the number of feasible nod"...
comment "// its search for more feasible nodes."
method_declaration (+158 nodes collapsed)
function_declaration (+335 nodes collapsed)
comment "// prioritizeNodes prioritizes the nodes by running the scor"...
comment "// which return a score for each node from the call to RunSc"...
comment "// The scores from each plugin are added together to make th"...
comment "// any extenders are run as well."
comment "// All scores are finally combined (added) to get the total "...
function_declaration (+1248 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "sortedNodeScores"
struct_type
struct "struct"
field_declaration_list
{ "{"
field_declaration
field_identifier "nodes"
type_identifier "nodeScoreHeap"
} "}"
function_declaration (+58 nodes collapsed)
method_declaration (+53 nodes collapsed)
comment "// Used only for unit tests."
method_declaration (+53 nodes collapsed)
method_declaration (+33 nodes collapsed)
comment "// nodeScoreHeap is a heap of fwk.NodePluginScores."
type_declaration
type "type"
type_spec
type_identifier "nodeScoreHeap"
slice_type
[ "["
] "]"
qualified_type
package_identifier "fwk"
. "."
type_identifier "NodePluginScores"
comment "// nodeScoreHeap implements heap.Interface."
var_declaration
var "var"
var_spec
identifier "_"
qualified_type
package_identifier "heap"
. "."
type_identifier "Interface"
= "="
expression_list
unary_expression
& "&"
composite_literal
type_identifier "nodeScoreHeap"
literal_value
{ "{"
} "}"
method_declaration (+26 nodes collapsed)
method_declaration (+89 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+75 nodes collapsed)
comment "// assume signals to the cache that a pod is already in the "...
comment "// When called during pod group scheduling cycle, pod is ass"...
method_declaration (+207 nodes collapsed)
comment "// bind binds a pod to a given node defined in a binding obj"...
comment "// The precedence for binding is: (1) extenders and (2) fram"...
comment "// We expect this to run asynchronously, so we handle bindin"...
method_declaration (+166 nodes collapsed)
comment "// TODO(#87159): Move this to a Plugin."
method_declaration (+250 nodes collapsed)
method_declaration (+158 nodes collapsed)
function_declaration (+56 nodes collapsed)
comment "// handleSchedulingFailure records an event for the pod that"...
comment "// pod has failed to schedule. Also, update the pod conditio"...
method_declaration (+1073 nodes collapsed)
comment "// truncateMessage truncates a message if it hits the NoteLe"...
function_declaration (+71 nodes collapsed)
function_declaration (+401 nodes collapsed)

After

source_file
comment "/*\nCopyright 2014 The Kubernetes Authors.\n\nLicensed under th"...
package_clause
package "package"
package_identifier "scheduler"
import_declaration (+144 nodes collapsed)
const_declaration (+28 nodes collapsed)
comment "// ScheduleOne does the entire scheduling workflow for a sin"...
comment "// It is serialized on the scheduling algorithm's host fitti"...
method_declaration (+284 nodes collapsed)
comment "// scheduleOnePod does the entire scheduling workflow for a "...
method_declaration (+471 nodes collapsed)
comment "// runBindingCycle runs a binding cycle algorithm."
method_declaration (+203 nodes collapsed)
var_declaration (+34 nodes collapsed)
comment "// schedulingCycle tries to schedule a single Pod."
method_declaration (+268 nodes collapsed)
comment "// prepareForBindingCycle applies the schedule result, gener"...
comment "// preparing for a binding cycle."
method_declaration
func "func"
parameter_list
( "("
parameter_declaration
identifier "sched"
pointer_type
* "*"
type_identifier "Scheduler"
) ")"
field_identifier "prepareForBindingCycle"
parameter_list (+46 nodes collapsed)
parameter_list
( "("
parameter_declaration
pointer_type
* "*"
qualified_type
package_identifier "framework"
. "."
type_identifier "QueuedPodInfo"
, ","
parameter_declaration
pointer_type
* "*"
qualified_type
package_identifier "fwk"
. "."
type_identifier "Status"
) ")"
block
{ "{"
statement_list
short_var_declaration (+24 nodes collapsed)
if_statement (+22 nodes collapsed)
short_var_declaration
expression_list
identifier "assumedPod"
:= ":="
expression_list
selector_expression
identifier "assumedPodInfo"
. "."
field_identifier "Pod"
comment "// Run \"permit\" plugins."
short_var_declaration
expression_list
identifier "pluginsWaitTime"
, ","
identifier "runPermitStatus"
:= ":="
expression_list
call_expression
selector_expression
identifier "schedFramework"
. "."
field_identifier "RunPermitPlugins"
argument_list
( "("
identifier "ctx"
, ","
identifier "state"
, ","
identifier "assumedPod"
, ","
selector_expression
identifier "scheduleResult"
. "."
field_identifier "SuggestedHost"
) ")"
if_statement
if "if"
call_expression
selector_expression
identifier "runPermitStatus"
. "."
field_identifier "IsWait"
argument_list
( "("
) ")"
block
{ "{"
statement_list
expression_statement
call_expression
selector_expression
identifier "schedFramework"
. "."
field_identifier "AddWaitingPod"
argument_list
( "("
identifier "assumedPod"
, ","
identifier "pluginsWaitTime"
) ")"
} "}"
else "else"
if_statement
if "if"
unary_expression
! "!"
call_expression
selector_expression
identifier "runPermitStatus"
. "."
field_identifier "IsSuccess"
argument_list
( "("
) ")"
block (+200 nodes collapsed)
comment "// At the end of a successful scheduling cycle, pop and move"...
if_statement (+75 nodes collapsed)
return_statement
return "return"
expression_list
identifier "assumedPodInfo"
, ","
nil "nil"
} "}"
comment "// schedulingAlgorithm runs fitering and scoring phases for "...
comment "// together with post filter when the pod is unschedulable."
method_declaration (+598 nodes collapsed)
comment "// assumeAndReserve assumes and reserves the pod in schedule"...
method_declaration (+402 nodes collapsed)
comment "// unreserveAndForget unreserves and forgets the pod from sc"...
comment "// This function shouldn't be called during binding cycle wi"...
comment "// but this shouldn't happen, because such pods cannot reach"...
method_declaration (+254 nodes collapsed)
comment "// bindingCycle tries to bind an assumed Pod."
method_declaration (+1065 nodes collapsed)
method_declaration (+273 nodes collapsed)
method_declaration (+98 nodes collapsed)
comment "// skipPodSchedule returns true if we could skip scheduling "...
method_declaration (+224 nodes collapsed)
comment "// schedulePod tries to schedule the given pod to one of the"...
comment "// If it succeeds, it will return the name of the node."
comment "// If it fails, it will return a FitError with reasons."
method_declaration (+612 nodes collapsed)
comment "// Filters the nodes to find the ones that fit the pod based"...
comment "// filter plugins and filter extenders."
method_declaration (+962 nodes collapsed)
method_declaration (+253 nodes collapsed)
comment "// hasScoring checks if scoring nodes is configured."
method_declaration (+82 nodes collapsed)
comment "// hasExtenderFilters checks if any extenders filter nodes."
method_declaration (+58 nodes collapsed)
comment "// findNodesThatPassFilters finds the nodes that fit the fil"...
method_declaration (+830 nodes collapsed)
comment "// numFeasibleNodesToFind returns the number of feasible nod"...
comment "// its search for more feasible nodes."
method_declaration (+158 nodes collapsed)
function_declaration (+335 nodes collapsed)
comment "// prioritizeNodes prioritizes the nodes by running the scor"...
comment "// which return a score for each node from the call to RunSc"...
comment "// The scores from each plugin are added together to make th"...
comment "// any extenders are run as well."
comment "// All scores are finally combined (added) to get the total "...
function_declaration (+1248 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "sortedNodeScores"
struct_type
struct "struct"
field_declaration_list
{ "{"
field_declaration
field_identifier "nodes"
type_identifier "nodeScoreHeap"
} "}"
function_declaration (+58 nodes collapsed)
method_declaration (+53 nodes collapsed)
comment "// Used only for unit tests."
method_declaration (+53 nodes collapsed)
method_declaration (+33 nodes collapsed)
comment "// nodeScoreHeap is a heap of fwk.NodePluginScores."
type_declaration
type "type"
type_spec
type_identifier "nodeScoreHeap"
slice_type
[ "["
] "]"
qualified_type
package_identifier "fwk"
. "."
type_identifier "NodePluginScores"
comment "// nodeScoreHeap implements heap.Interface."
var_declaration
var "var"
var_spec
identifier "_"
qualified_type
package_identifier "heap"
. "."
type_identifier "Interface"
= "="
expression_list
unary_expression
& "&"
composite_literal
type_identifier "nodeScoreHeap"
literal_value
{ "{"
} "}"
method_declaration (+26 nodes collapsed)
method_declaration (+89 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+75 nodes collapsed)
comment "// assume signals to the cache that a pod is already in the "...
comment "// When called during pod group scheduling cycle, pod is ass"...
method_declaration (+207 nodes collapsed)
comment "// bind binds a pod to a given node defined in a binding obj"...
comment "// The precedence for binding is: (1) extenders and (2) fram"...
comment "// We expect this to run asynchronously, so we handle bindin"...
method_declaration (+166 nodes collapsed)
comment "// TODO(#87159): Move this to a Plugin."
method_declaration (+250 nodes collapsed)
method_declaration (+158 nodes collapsed)
function_declaration (+56 nodes collapsed)
comment "// handleSchedulingFailure records an event for the pod that"...
comment "// pod has failed to schedule. Also, update the pod conditio"...
method_declaration (+1073 nodes collapsed)
comment "// truncateMessage truncates a message if it hits the NoteLe"...
function_declaration (+71 nodes collapsed)
function_declaration (+401 nodes collapsed)