summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2020-03-06 11:52:58 +0800
committerBin Yang <bin.yang@windriver.com>2020-03-06 11:52:58 +0800
commitcff26d9fb92100ad5da1a9d8d7118f6113f1e9a7 (patch)
tree1ec7db8784ff342a246c9a2122bca81f54c56949 /share
parente10d2f988ea985b788e16ce1d0adf77d1f4cbaef (diff)
Register k8s cluster over starlingx distributed cloud
Change-Id: If6a475d7e6752721ed9aee1dbc2526807ceb3799 Issue-ID: MULTICLOUD-1023 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share')
-rw-r--r--share/starlingx_base/registration/registration.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/share/starlingx_base/registration/registration.py b/share/starlingx_base/registration/registration.py
index 6064b5ee..9fb0f57d 100644
--- a/share/starlingx_base/registration/registration.py
+++ b/share/starlingx_base/registration/registration.py
@@ -245,6 +245,17 @@ class RegistryHelper(newton_registration.RegistryHelper):
new_vimid = extsys.encode_vim_id(
cloud_owner, gen_cloud_region_id)
super(RegistryHelper, self).registryV0(new_vimid, project_idorname)
+ # update k8s connectivity
+ try:
+ newviminfo = VimDriverUtils.get_vim_info(new_vimid)
+ sess = VimDriverUtils.get_session(
+ newviminfo, tenant_name=newviminfo.get('tenant', None))
+ self._update_k8s_info(cloud_owner, gen_cloud_region_id, newviminfo, sess)
+ except Exception as e:
+ self.__logger.debug(
+ "update k8s info failes for cloud region:%s,%s, %s"
+ % (cloud_owner, gen_cloud_region_id, str(e)))
+ # continue the registration without reporting error
except Exception as e:
self._logger.debug("registryV0 fails %s" % str(e))
@@ -255,7 +266,9 @@ class RegistryHelper(newton_registration.RegistryHelper):
#re-fetch viminfo
viminfo = VimDriverUtils.get_vim_info(vimid)
except Exception as e:
- self._logger.debug("update cloud region fails %s" % str(e))
+ self._logger.debug(
+ "update cloud region fails for cloud region: %s,%s, %s"
+ % (cloud_owner, cloud_region_id, str(e)))
# update k8s connectivity
try: