From 7d87a8a213c3241124350aa4fa631b98cf6f260d Mon Sep 17 00:00:00 2001 From: shubham82 Date: Wed, 5 Jun 2024 14:49:54 +0530 Subject: [PATCH] Backport #6528 [CA] Fix expectedToRegister to respect instances with nil status into CA1.29 --- cluster-autoscaler/clusterstate/clusterstate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/clusterstate/clusterstate.go b/cluster-autoscaler/clusterstate/clusterstate.go index fc8602f58607..54002840ef60 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -1044,7 +1044,7 @@ func getNotRegisteredNodes(allNodes []*apiv1.Node, cloudProviderNodeInstances ma } func expectedToRegister(instance cloudprovider.Instance) bool { - return instance.Status != nil && instance.Status.State != cloudprovider.InstanceDeleting && instance.Status.ErrorInfo == nil + return instance.Status == nil || (instance.Status.State != cloudprovider.InstanceDeleting && instance.Status.ErrorInfo == nil) } // Calculates which of the registered nodes in Kubernetes that do not exist in cloud provider.