summaryrefslogtreecommitdiffstats
path: root/share/newton_base
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2020-02-28 12:38:02 +0800
committerBin Yang <bin.yang@windriver.com>2020-02-28 15:05:49 +0800
commit890c369ab3128ee8bac921c3bf2be6961583db7d (patch)
tree89185cb3c2c652c8cce23e75910d99b3160dc06c /share/newton_base
parentd41752458f677c7c1c5cd9b5a9c4af1990d116e8 (diff)
Wrap infra_workload API call to k8s plugin
Create profile during post API Change-Id: Ia68eb34f4c1baf01ad96aaaf6b4147a78374de60 Issue-ID: MULTICLOUD-1003 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/newton_base')
-rw-r--r--share/newton_base/util.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/newton_base/util.py b/share/newton_base/util.py
index aa03b65b..b06529bb 100644
--- a/share/newton_base/util.py
+++ b/share/newton_base/util.py
@@ -177,3 +177,20 @@ class VimDriverUtils(object):
return result
return profiled_func
return wrapper
+
+
+ @staticmethod
+ def check_k8s_cluster(viminfo):
+ """
+ check if cloud region is k8s cluster
+ """
+ software_version = viminfo.get("cloud_extra_info_json", {})\
+ .get("isystem", {}).get("software_version")
+
+ is_k8s_cluster = False
+ if software_version == "19.12":
+ is_k8s_cluster = True
+ elif software_version == "19.10":
+ is_k8s_cluster = True
+
+ return is_k8s_cluster