Handle edge case when node capacity is undefined gracefully. Closes #7280. (kubeflow/kubeflow#7281)
* Handle edge case when node capacity is undefined gracefully * Change log message to capacity * No need to make the message a warning * Resolve flake8 issue * ensure closing bracket matches indentation of opening bracket * Fix flake8 issues from other files
This commit is contained in:
parent
bead8d49b7
commit
dfe131a537
|
|
@ -114,7 +114,12 @@ def get_gpu_vendors():
|
|||
installed_resources = set()
|
||||
nodes = api.list_nodes().items
|
||||
for node in nodes:
|
||||
installed_resources.update(node.status.capacity.keys())
|
||||
if node.status.capacity:
|
||||
installed_resources.update(status.capacity.keys())
|
||||
else:
|
||||
log.debug(
|
||||
"Capacity was not available for node {node.metadata.name}"
|
||||
)
|
||||
|
||||
# Keep the vendors the key of which exists in at least one node
|
||||
available_vendors = installed_resources.intersection(config_vendor_keys)
|
||||
|
|
|
|||
Loading…
Reference in New Issue