From 7128cb795f00e0f70f2f3d34590dd9da787fe356 Mon Sep 17 00:00:00 2001 From: Yarin Miran Date: Tue, 13 Feb 2024 11:18:01 +0200 Subject: [PATCH] Fix expectedToRegister to respect instances with nil status --- 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 2240d3f22883..aa3e93be9268 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -1035,7 +1035,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.