diff --git a/src/dsmlp/ext/kube.py b/src/dsmlp/ext/kube.py index 5231e81..c1cbd08 100644 --- a/src/dsmlp/ext/kube.py +++ b/src/dsmlp/ext/kube.py @@ -35,7 +35,10 @@ def get_gpus_in_namespace(self, name: str) -> int: gpu_count = 0 for pod in pods.items: - gpu_count += int(pod.spec.containers.resources.requests['GPU_LABEL']) + try: + gpu_count += int(pod.spec.containers.resources.requests['GPU_LABEL']) + except KeyError: + pass return gpu_count