From: quilesj Date: Thu, 23 Jan 2020 09:28:26 +0000 (+0000) Subject: Generate names for K8s pods when file or url X-Git-Tag: release-v8.0-start~38 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F8519%2F2;p=osm%2FN2VC.git Generate names for K8s pods when file or url Change-Id: I99e50cda65df2462c90775eb84a096232428ffc4 Signed-off-by: quilesj --- diff --git a/n2vc/k8s_helm_conn.py b/n2vc/k8s_helm_conn.py index f7ff853..f49159e 100644 --- a/n2vc/k8s_helm_conn.py +++ b/n2vc/k8s_helm_conn.py @@ -770,6 +770,15 @@ class K8sHelmConnector(K8sConnector): def _generate_release_name( chart_name: str ): + # check embeded chart (file or dir) + if chart_name.startswith('/'): + # extract file or directory name + chart_name = chart_name[chart_name.rfind('/')+1:] + # check URL + elif '://' in chart_name: + # extract last portion of URL + chart_name = chart_name[chart_name.rfind('/')+1:] + name = '' for c in chart_name: if c.isalpha() or c.isnumeric():