Bug 2122 fixed: used cluster_id instead of cluster_uuid in repo_add.reverse_sync
Change-Id: I8185a892a2db23bdeecee3a826af9414b8f8a2f0
Signed-off-by: limon <alimonj@indra.es>
diff --git a/n2vc/k8s_helm_base_conn.py b/n2vc/k8s_helm_base_conn.py
index 82ae067..d2de810 100644
--- a/n2vc/k8s_helm_base_conn.py
+++ b/n2vc/k8s_helm_base_conn.py
@@ -186,22 +186,20 @@
)
# sync fs
- self.fs.reverse_sync(from_path=cluster_uuid)
+ self.fs.reverse_sync(from_path=cluster_id)
- async def repo_update(self, cluster_uuid: str, name: str, repo_type: str = "chart"):
+ async def repo_update(self, cluster_id: str, name: str, repo_type: str = "chart"):
self.log.debug(
- "Cluster {}, updating {} repository {}".format(
- cluster_uuid, repo_type, name
- )
+ "Cluster {}, updating {} repository {}".format(cluster_id, repo_type, name)
)
# init_env
paths, env = self._init_paths_env(
- cluster_name=cluster_uuid, create_if_not_exist=True
+ cluster_name=cluster_id, create_if_not_exist=True
)
# sync local dir
- self.fs.sync(from_path=cluster_uuid)
+ self.fs.sync(from_path=cluster_id)
# helm repo update
command = "{} repo update {}".format(self._helm_command, name)
@@ -211,7 +209,7 @@
)
# sync fs
- self.fs.reverse_sync(from_path=cluster_uuid)
+ self.fs.reverse_sync(from_path=cluster_id)
async def repo_list(self, cluster_uuid: str) -> list:
"""
@@ -492,7 +490,7 @@
repo = self._split_repo(kdu_model)
if repo:
- self.repo_update(cluster_uuid, repo)
+ self.repo_update(cluster_id, repo)
command = self._get_upgrade_command(
kdu_model,
diff --git a/n2vc/tests/unit/test_k8s_helm3_conn.py b/n2vc/tests/unit/test_k8s_helm3_conn.py
index 40f3820..e32e56e 100644
--- a/n2vc/tests/unit/test_k8s_helm3_conn.py
+++ b/n2vc/tests/unit/test_k8s_helm3_conn.py
@@ -92,7 +92,7 @@
self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id)
self.helm_conn.fs.reverse_sync.assert_called_once_with(
- from_path=self.cluster_uuid
+ from_path=self.cluster_id
)
self.assertEqual(
self.helm_conn._local_async_exec.call_count,
diff --git a/n2vc/tests/unit/test_k8s_helm_conn.py b/n2vc/tests/unit/test_k8s_helm_conn.py
index 5e36938..8a0c1ea 100644
--- a/n2vc/tests/unit/test_k8s_helm_conn.py
+++ b/n2vc/tests/unit/test_k8s_helm_conn.py
@@ -69,7 +69,7 @@
self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id)
self.helm_conn.fs.reverse_sync.assert_called_once_with(
- from_path=self.cluster_uuid
+ from_path=self.cluster_id
)
self.assertEqual(
self.helm_conn._local_async_exec.call_count,