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/?p=osm%2FN2VC.git;a=commitdiff_plain;h=069f0a310433dcfe57431fd7146ef95f87c1505d;hp=d4cee8c1edd901a2922bb2593e5b643844f83b3a 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)