Kami commented on a change in pull request #1667:
URL: https://github.com/apache/libcloud/pull/1667#discussion_r834169524



##########
File path: libcloud/container/drivers/kubernetes.py
##########
@@ -30,20 +33,178 @@
 from libcloud.container.providers import Provider
 from libcloud.container.types import ContainerState
 
-__all__ = ["KubernetesContainerDriver"]
+from libcloud.compute.types import NodeState
+from libcloud.compute.base import Node
+from libcloud.compute.base import NodeSize
+from libcloud.compute.base import NodeImage
+from libcloud.common.exceptions import BaseHTTPError
+
+__all__ = [
+    "KubernetesContainerDriver",
+    "to_n_bytes",
+    "to_memory_str",
+    "to_cpu_str",
+    "to_n_cpus",
+]
 
 
 ROOT_URL = "/api/"
 
 
+K8S_UNIT_MAP = OrderedDict(
+    {
+        "K": 1000,
+        "Ki": 1024,
+        "M": 1000 * 1000,
+        "Mi": 1024 * 1024,
+        "G": 1000 * 1000 * 1000,
+        "Gi": 1024 * 1024 * 1024,
+    }
+)
+
+
+def to_n_bytes(memory_str: str) -> int:

Review comment:
       It also wouldn't hurt to add direct test cases for all those utility 
conversion functions :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to