From 6cf42037512b266d9581a745461a131ddfe0da60 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 26 Jan 2024 10:51:35 +0100 Subject: [PATCH] dra scheduler: reformat code By continuing with the next item in the if clause, the else is no longer needed and indention can be reduced. --- .../dynamicresources/dynamicresources.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index b2f3c4b4c7b..9ce1a424ed2 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -911,15 +911,16 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat // updating the ResourceClaim status, we assume that reserving // will work and only do it for real during binding. If it fails at // that time, some other pod was faster and we have to try again. - } else { - // Must be delayed allocation. - numDelayedAllocationPending++ + continue + } - // Did the driver provide information that steered node - // selection towards a node that it can support? - if statusForClaim(state.podSchedulingState.schedulingCtx, pod.Spec.ResourceClaims[index].Name) != nil { - numClaimsWithStatusInfo++ - } + // Must be delayed allocation. + numDelayedAllocationPending++ + + // Did the driver provide information that steered node + // selection towards a node that it can support? + if statusForClaim(state.podSchedulingState.schedulingCtx, pod.Spec.ResourceClaims[index].Name) != nil { + numClaimsWithStatusInfo++ } }