Update only the repo that was added instead of all repos 25/12025/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 4 May 2022 09:07:41 +0000 (11:07 +0200)
committergarciadav <david.garcia@canonical.com>
Mon, 23 May 2022 07:42:59 +0000 (09:42 +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 8c52a7b..37df6c1 100644 (file)
@@ -178,8 +178,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 7542fab..25a5c0d 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 5ddb490..9508b66 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)