X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=n2vc%2Fk8s_helm_conn.py;h=5fe624b6e93dbf4c9230ab50c2843058f6e182bb;hb=6343d434fa3cec28d8b9b470054d3a13ada8865a;hp=444f2dae84492949483c06ebb50cfc5aa6b0304b;hpb=ed0ff05f09f276c753e5aa5439a3a1252b6a07e4;p=osm%2FN2VC.git diff --git a/n2vc/k8s_helm_conn.py b/n2vc/k8s_helm_conn.py index 444f2da..5fe624b 100644 --- a/n2vc/k8s_helm_conn.py +++ b/n2vc/k8s_helm_conn.py @@ -20,6 +20,7 @@ # contact with: nfvlabs@tid.es ## import asyncio +from typing import Union import os import yaml @@ -109,11 +110,12 @@ class K8sHelmConnector(K8sHelmBaseConnector): happen before any _initial-config-primitive_of the VNF is called). :param cluster_uuid: UUID of a K8s cluster known by OSM - :param kdu_model: chart/ reference (string), which can be either + :param kdu_model: chart/reference (string), which can be either of these options: - a name of chart available via the repos known by OSM - - a path to a packaged chart - - a path to an unpacked chart directory or a URL + (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: If set, installation process purges chart/bundle on fail, also will wait until all the K8s objects are active @@ -464,9 +466,9 @@ class K8sHelmConnector(K8sHelmBaseConnector): cluster_id: str, kdu_instance: str, namespace: str = None, + yaml_format: bool = False, show_error_log: bool = False, - return_text: bool = False, - ): + ) -> Union[str, dict]: self.log.debug( "status of kdu_instance: {}, namespace: {} ".format(kdu_instance, namespace) @@ -486,7 +488,7 @@ class K8sHelmConnector(K8sHelmBaseConnector): env=env, ) - if return_text: + if yaml_format: return str(output) if rc != 0: @@ -544,7 +546,7 @@ class K8sHelmConnector(K8sHelmBaseConnector): ) status = await self._status_kdu( - cluster_id=cluster_id, kdu_instance=kdu_instance, return_text=False + cluster_id=cluster_id, kdu_instance=kdu_instance, yaml_format=False ) # extract info.status.resources-> str