Bug 2122 fixed: used cluster_id instead of cluster_uuid in repo_add.reverse_sync 98/12398/5
authorlimon <alimonj@indra.es>
Thu, 21 Jul 2022 11:19:44 +0000 (13:19 +0200)
committerlimon <alimonj@indra.es>
Thu, 21 Jul 2022 13:31:05 +0000 (15:31 +0200)
Change-Id: I8185a892a2db23bdeecee3a826af9414b8f8a2f0
Signed-off-by: limon <alimonj@indra.es>
n2vc/k8s_helm_base_conn.py
n2vc/tests/unit/test_k8s_helm3_conn.py
n2vc/tests/unit/test_k8s_helm_conn.py

index 82ae067..d2de810 100644 (file)
@@ -186,22 +186,20 @@ class K8sHelmBaseConnector(K8sConnector):
         )
 
         # 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 @@ class K8sHelmBaseConnector(K8sConnector):
         )
 
         # 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 @@ class K8sHelmBaseConnector(K8sConnector):
 
         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,
index 40f3820..e32e56e 100644 (file)
@@ -92,7 +92,7 @@ class TestK8sHelm3Conn(asynctest.TestCase):
 
         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,
index 5e36938..8a0c1ea 100644 (file)
@@ -69,7 +69,7 @@ class TestK8sHelmConn(asynctest.TestCase):
 
         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,