From fedcd6533cd4fec582722459dddd806354b29797 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 4 May 2022 11:07:41 +0200 Subject: [PATCH] Update only the repo that was added instead of all repos Change-Id: I70c75ced584b40873566a36f2dfc900abc824767 Signed-off-by: garciadeblas --- n2vc/k8s_helm_base_conn.py | 4 ++-- n2vc/tests/unit/test_k8s_helm3_conn.py | 4 +++- n2vc/tests/unit/test_k8s_helm_conn.py | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/n2vc/k8s_helm_base_conn.py b/n2vc/k8s_helm_base_conn.py index 8c52a7b..37df6c1 100644 --- a/n2vc/k8s_helm_base_conn.py +++ b/n2vc/k8s_helm_base_conn.py @@ -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( diff --git a/n2vc/tests/unit/test_k8s_helm3_conn.py b/n2vc/tests/unit/test_k8s_helm3_conn.py index 7542fab..25a5c0d 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 5ddb490..9508b66 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) -- 2.25.1