You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2023/05/09 16:12:00 UTC

[jira] [Resolved] (YUNIKORN-1723) Remove string comparison from hasReadyCondition() function

     [ https://issues.apache.org/jira/browse/YUNIKORN-1723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Bacsko resolved YUNIKORN-1723.
------------------------------------
    Fix Version/s: 1.3.0
       Resolution: Fixed

> Remove string comparison from hasReadyCondition() function
> ----------------------------------------------------------
>
>                 Key: YUNIKORN-1723
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1723
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: shim - kubernetes
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.3.0
>
>         Attachments: hasReadyCondition.png
>
>
> Kubemark testing identified an expensive method in the shim, which is called for every node update.
> {noformat}
> func hasReadyCondition(node *v1.Node) bool {
>    if node != nil && node.Status.String() != "nil" {
>       for _, condition := range node.Status.Conditions {
>          if condition.Type == v1.NodeReady && condition.Status == v1.ConditionTrue {
>             return true
>          }
>       }
>    }
>    return false
> } {noformat}
>  
> {{node.Status}} cannot be nil, and {{Status.String()}} builds a decently sized string. The check against "nil" should be deleted.
>  
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org