projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add generate_kdu_instance_name method in K8sConn
[osm/N2VC.git]
/
n2vc
/
k8s_helm_conn.py
diff --git
a/n2vc/k8s_helm_conn.py
b/n2vc/k8s_helm_conn.py
index
442ed06
..
ad230b5
100644
(file)
--- a/
n2vc/k8s_helm_conn.py
+++ b/
n2vc/k8s_helm_conn.py
@@
-72,7
+72,8
@@
class K8sHelmConnector(K8sHelmBaseConnector):
# initialize helm client-only
self.log.debug("Initializing helm client-only...")
# initialize helm client-only
self.log.debug("Initializing helm client-only...")
- command = "{} init --client-only".format(self._helm_command)
+ command = "{} init --client-only --stable-repo-url {} ".format(
+ self._helm_command, self._stable_repo_url)
try:
asyncio.ensure_future(
self._local_async_exec(command=command, raise_exception_on_error=False)
try:
asyncio.ensure_future(
self._local_async_exec(command=command, raise_exception_on_error=False)
@@
-91,6
+92,7
@@
class K8sHelmConnector(K8sHelmBaseConnector):
self,
cluster_uuid: str,
kdu_model: str,
self,
cluster_uuid: str,
kdu_model: str,
+ kdu_instance: str,
atomic: bool = True,
timeout: float = 300,
params: dict = None,
atomic: bool = True,
timeout: float = 300,
params: dict = None,
@@
-109,22
+111,25
@@
class K8sHelmConnector(K8sHelmBaseConnector):
cluster_name=cluster_id, create_if_not_exist=True
)
cluster_name=cluster_id, create_if_not_exist=True
)
- kdu_instance = await self._install_impl(cluster_id,
- kdu_model,
- paths,
- env,
- atomic=atomic,
- timeout=timeout,
- params=params,
- db_dict=db_dict,
- kdu_name=kdu_name,
- namespace=namespace)
+ await self._install_impl(
+ cluster_id,
+ kdu_model,
+ paths,
+ env,
+ kdu_instance,
+ atomic=atomic,
+ timeout=timeout,
+ params=params,
+ db_dict=db_dict,
+ kdu_name=kdu_name,
+ namespace=namespace,
+ )
# sync fs
self.fs.reverse_sync(from_path=cluster_id)
self.log.debug("Returning kdu_instance {}".format(kdu_instance))
# sync fs
self.fs.reverse_sync(from_path=cluster_id)
self.log.debug("Returning kdu_instance {}".format(kdu_instance))
- return
kdu_instanc
e
+ return
Tru
e
async def inspect_kdu(self, kdu_model: str, repo_url: str = None) -> str:
async def inspect_kdu(self, kdu_model: str, repo_url: str = None) -> str:
@@
-285,12
+290,13
@@
class K8sHelmConnector(K8sHelmBaseConnector):
self.log.info("Initializing helm in client: {}".format(cluster_id))
command = (
"{} --kubeconfig={} --tiller-namespace={} "
self.log.info("Initializing helm in client: {}".format(cluster_id))
command = (
"{} --kubeconfig={} --tiller-namespace={} "
- "--home={} init --client-only"
+ "--home={} init --client-only
--stable-repo-url {}
"
).format(
self._helm_command,
paths["kube_config"],
namespace,
paths["helm_dir"],
).format(
self._helm_command,
paths["kube_config"],
namespace,
paths["helm_dir"],
+ self._stable_repo_url,
)
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=True, env=env
)
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=True, env=env