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: v7.0.1rc3~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=8d780a9e0414686f0c91be6dc460275fb0155f89;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 e57c42f..417604a 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():