Update only the repo that was added instead of all repos 71/11871/4
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 4 May 2022 09:07:41 +0000 (11:07 +0200)
committergarciadav <david.garcia@canonical.com>
Fri, 6 May 2022 11:50:03 +0000 (13:50 +0200)
Change-Id: I70c75ced584b40873566a36f2dfc900abc824767
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
n2vc/k8s_helm_base_conn.py
n2vc/tests/unit/test_k8s_helm3_conn.py
n2vc/tests/unit/test_k8s_helm_conn.py

index 9b0ca86..adbdefc 100644 (file)
@@ -201,8 +201,8 @@ class K8sHelmBaseConnector(K8sConnector):
         )
 
         # helm repo update
-        command = "env KUBECONFIG={} {} repo update".format(
-            paths["kube_config"], self._helm_command
+        command = "env KUBECONFIG={} {} repo update {}".format(
+            paths["kube_config"], self._helm_command, name
         )
         self.log.debug("updating repo: {}".format(command))
         await self._local_async_exec(
index 775b0a7..d1b7903 100644 (file)
@@ -102,7 +102,9 @@ class TestK8sHelm3Conn(asynctest.TestCase):
             ),
         )
 
-        repo_update_command = "env KUBECONFIG=./tmp/helm3_cluster_id/.kube/config /usr/bin/helm3 repo update"
+        repo_update_command = (
+            "env KUBECONFIG=./tmp/helm3_cluster_id/.kube/config /usr/bin/helm3 repo update {}"
+        ).format(repo_name)
         repo_add_command = (
             "env KUBECONFIG=./tmp/helm3_cluster_id/.kube/config /usr/bin/helm3 repo add {} {}"
         ).format(repo_name, repo_url)
index ae9338d..fb586a3 100644 (file)
@@ -79,7 +79,9 @@ class TestK8sHelmConn(asynctest.TestCase):
             ),
         )
 
-        repo_update_command = "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo update"
+        repo_update_command = (
+            "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo update {}"
+        ).format(repo_name)
         repo_add_command = (
             "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo add {} {}"
         ).format(repo_name, repo_url)