From 382147847becb857f41f17d0fa796c48e0780b89 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine <57888439+jervine-gogo@users.noreply.github.com> Date: Wed, 16 Dec 2020 11:55:14 +0800 Subject: [PATCH] Use helm3 for chart list --- main.py | 5 ++--- routes/kube_helm_routes.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 9fa1e69..63261ff 100644 --- a/main.py +++ b/main.py @@ -49,9 +49,8 @@ def get_deployments(namespace): data = json.loads(output) return data -def get_charts(tiller_ns, namespace): - command = "/usr/local/bin/helm --tiller-namespace " + tiller_ns + " list --output json" #helm2 - #command = "/usr/local/bin/helm -n " + namespace + " list -ojson" #helm3 +def get_charts(ns): + command = "/usr/local/bin/helm -n " + ns + " list -ojson" #helm3 info(f"Running command: {command}") try: output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8") diff --git a/routes/kube_helm_routes.py b/routes/kube_helm_routes.py index 184de81..32835eb 100644 --- a/routes/kube_helm_routes.py +++ b/routes/kube_helm_routes.py @@ -25,9 +25,9 @@ def chartVersions(): return render_template('chartRevisionList.html', table=table) -@routes.route('/nsLookup//') -def namespaceLookup(tiller_ns, namespace): - charts = get_charts(tiller_ns, namespace) +@routes.route('/nsLookup//') +def namespaceLookup(ns): + charts = get_charts(ns) return jsonify(charts) @routes.route('/deployChartRevision///', methods=['POST'])