[ 
https://issues.apache.org/jira/browse/YUNIKORN-2577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840149#comment-17840149
 ] 

Wilfred Spiegelenburg edited comment on YUNIKORN-2577 at 4/23/24 5:13 PM:
--------------------------------------------------------------------------

BTW: not sure why {{GetPodNoLock}} returns two values. The pod is nil if the 
boolean is false, pod is not nil if boolean is true.... The signature can be 
simplified to just returning the pod. Should probably be a new jira.

edit: lpgged YUNIKORN-2578 for the refactor


was (Author: wifreds):
BTW: not sure why {{GetPodNoLock}} returns two values. The pod is nil if the 
boolean is false, pod is not nil if boolean is true.... The signature can be 
simplified to just returning the pod. Should probably be a new jira.

> Remove named returns from IsPodFitNodeViaPreemption
> ---------------------------------------------------
>
>                 Key: YUNIKORN-2577
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2577
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: shim - kubernetes
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Hsien-Cheng(Ryan) Huang
>            Priority: Minor
>              Labels: newbie
>
> IsPodFitNodeViaPreemption has defined named returns but does not use them. 
> They should be removed as the way they are used can cause issues that are 
> hard to debug.
> As part of this change we need to further cleanup:
> * The variable {{ok}} also gets shadowed multiple times, not just from the 
> named return declaration.
> * The if construct around {{GetPodNoLock()}} is not needed as it returns a 
> nil for the pod if it returns false. Just adding the result for the pod 
> always has the same effect.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to