From: garciadeblas Date: Wed, 4 May 2022 09:07:41 +0000 (+0200) Subject: Update only the repo that was added instead of all repos X-Git-Tag: v12.0.0rc1~18 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F11871%2F4;p=osm%2FN2VC.git Update only the repo that was added instead of all repos Change-Id: I70c75ced584b40873566a36f2dfc900abc824767 Signed-off-by: garciadeblas --- diff --git a/n2vc/k8s_helm_base_conn.py b/n2vc/k8s_helm_base_conn.py index 9b0ca86..adbdefc 100644 --- a/n2vc/k8s_helm_base_conn.py +++ b/n2vc/k8s_helm_base_conn.py @@ -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( diff --git a/n2vc/tests/unit/test_k8s_helm3_conn.py b/n2vc/tests/unit/test_k8s_helm3_conn.py index 775b0a7..d1b7903 100644 --- a/n2vc/tests/unit/test_k8s_helm3_conn.py +++ b/n2vc/tests/unit/test_k8s_helm3_conn.py @@ -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) diff --git a/n2vc/tests/unit/test_k8s_helm_conn.py b/n2vc/tests/unit/test_k8s_helm_conn.py index ae9338d..fb586a3 100644 --- a/n2vc/tests/unit/test_k8s_helm_conn.py +++ b/n2vc/tests/unit/test_k8s_helm_conn.py @@ -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)