[autoscaler][Kubernetes] Fix non_terminated_nodes consistency (#14976)

* Verify pod termination

* deletion-timestamp

* get rid of extra constant
This commit is contained in:
Dmitri Gekhtman 2021-03-28 17:52:12 -04:00 committed by GitHub
parent cdbaf930ab
commit dcf41d868c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,12 @@ class KubernetesNodeProvider(NodeProvider):
field_selector=field_selector,
label_selector=label_selector)
return [pod.metadata.name for pod in pod_list.items]
# Don't return pods marked for deletion,
# i.e. pods with non-null metadata.DeletionTimestamp.
return [
pod.metadata.name for pod in pod_list.items
if pod.metadata.deletion_timestamp is None
]
def is_running(self, node_id):
pod = core_api().read_namespaced_pod(node_id, self.namespace)