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/05 08:41:00 UTC
[jira] [Created] (YUNIKORN-1723) Remove string comparison from hasReadyCondition() function
Peter Bacsko created YUNIKORN-1723:
--------------------------------------
Summary: 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
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