Fix expectedToRegister to respect instances with nil status

This commit is contained in:
Yarin Miran 2024-02-13 11:18:01 +02:00
parent abc077e222
commit 7128cb795f
1 changed files with 1 additions and 1 deletions

View File

@ -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.