X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=n2vc%2Fk8s_helm3_conn.py;h=0a8f7e0f1922530abfbcbabafb25f9e681cfd6e7;hb=90a5c32230d290d3b0b654e57e9b72f6f3bb0815;hp=bb08f0792aaeddd542fa1e8e065d8efbeb2d7139;hpb=a8980cc3f6508f2659dc4ba4fcbeed65ba3c8e95;p=osm%2FN2VC.git diff --git a/n2vc/k8s_helm3_conn.py b/n2vc/k8s_helm3_conn.py index bb08f07..0a8f7e0 100644 --- a/n2vc/k8s_helm3_conn.py +++ b/n2vc/k8s_helm3_conn.py @@ -84,7 +84,12 @@ class K8sHelm3Connector(K8sHelmBaseConnector): """Install a helm chart :param cluster_uuid str: The UUID of the cluster to install to - :param kdu_model str: The name or path of a bundle to install + :param kdu_model str: chart/reference (string), which can be either + of these options: + - a name of chart available via the repos known by OSM + (e.g. stable/openldap, stable/openldap:1.2.4) + - a path to a packaged chart (e.g. mychart.tgz) + - a path to an unpacked chart directory or a URL (e.g. mychart) :param kdu_instance: Kdu instance name :param atomic bool: If set, waits until the model is active and resets the cluster on failure. @@ -346,10 +351,23 @@ class K8sHelm3Connector(K8sHelmBaseConnector): return [] def _get_inspect_command( - self, inspect_command: str, kdu_model: str, repo_str: str, version: str + self, show_command: str, kdu_model: str, repo_str: str, version: str ): + """Generates the command to obtain the information about an Helm Chart package + (´helm show ...´ command) + + Args: + show_command: the second part of the command (`helm show `) + kdu_model: The name or path of an Helm Chart + repo_url: Helm Chart repository url + version: constraint with specific version of the Chart to use + + Returns: + str: the generated Helm Chart command + """ + inspect_command = "{} show {} {}{} {}".format( - self._helm_command, inspect_command, kdu_model, repo_str, version + self._helm_command, show_command, kdu_model, repo_str, version ) return inspect_command