[
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: [email protected]
For additional commands, e-mail: [email protected]