Fix bug 1400: Change repo stable for helm2
[osm/N2VC.git] / n2vc / k8s_helm_base_conn.py
index 1aa95d2..af22ecc 100644 (file)
@@ -43,6 +43,7 @@ class K8sHelmBaseConnector(K8sConnector):
     ####################################################################################
     """
     service_account = "osm"
+    _STABLE_REPO_URL = "https://charts.helm.sh/stable"
 
     def __init__(
         self,
@@ -52,6 +53,7 @@ class K8sHelmBaseConnector(K8sConnector):
         helm_command: str = "/usr/bin/helm",
         log: object = None,
         on_update_db=None,
+        vca_config: dict = None,
     ):
         """
 
@@ -82,6 +84,12 @@ class K8sHelmBaseConnector(K8sConnector):
         self._helm_command = helm_command
         self._check_file_exists(filename=helm_command, exception_if_not_exists=True)
 
+        # obtain stable repo url from config or apply default
+        if not vca_config or not vca_config.get("stablerepourl"):
+            self._stable_repo_url = self._STABLE_REPO_URL
+        else:
+            self._stable_repo_url = vca_config.get("stablerepourl")
+
     @staticmethod
     def _get_namespace_cluster_id(cluster_uuid: str) -> (str, str):
         """