You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2022/04/12 14:24:01 UTC

[GitHub] [libcloud] dimgal1 commented on a diff in pull request #1667: Update Kubernetes driver

dimgal1 commented on code in PR #1667:
URL: https://github.com/apache/libcloud/pull/1667#discussion_r848500552


##########
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:
   Sorry for the delay, I added the test cases



-- 
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-unsubscribe@libcloud.apache.org

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