From bc355a11bd4f77d67cec3a5a979c42cbdff5a92e Mon Sep 17 00:00:00 2001 From: quilesj Date: Thu, 23 Jan 2020 09:28:26 +0000 Subject: [PATCH] Generate names for K8s pods when file or url Change-Id: I99e50cda65df2462c90775eb84a096232428ffc4 Signed-off-by: quilesj --- n2vc/k8s_helm_conn.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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(): -- 2.25.1