Merge pull request #101853 from sanposhiho/scheduler_perf/fix/error-handling-correctly

scheduler_perf: correct error handling
This commit is contained in:
Kubernetes Prow Robot 2021-05-25 15:57:15 -07:00 committed by GitHub
commit b0e9cdb298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1220,7 +1220,8 @@ func DoPrepareNode(client clientset.Interface, node *v1.Node, strategy PrepareNo
func DoCleanupNode(client clientset.Interface, nodeName string, strategy PrepareNodeStrategy) error {
var err error
for attempt := 0; attempt < retries; attempt++ {
node, err := client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})
var node *v1.Node
node, err = client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})
if err != nil {
return fmt.Errorf("Skipping cleanup of Node: failed to get Node %v: %v", nodeName, err)
}