Fix cpu value assignment
@@ -270,8 +270,11 @@ class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver):
memory = memory.rstrip("G")
memory = int(memory) // 1000
cpu = data["status"].get("capacity", {}).get("cpu", 1)
- if not isinstance(cpu, int):
- cpu = int(cpu.rstrip("m"))
+ cpu_is_not_int = not isinstance(cpu, int)
+ if cpu_is_not_int and cpu.endswith("m"):
+ cpu = int(cpu.strip("m")) / 1000
+ elif cpu_is_not_int:
+ cpu = int(cpu)
# TODO: Find image
image_name = "undefined"
image = NodeImage(image_name, image_name, driver)
