Use helm3 for chart list

This commit is contained in:
Jonathan Ervine 2020-12-16 11:55:14 +08:00
parent 258793c6d8
commit 382147847b
2 changed files with 5 additions and 6 deletions

View File

@ -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")

View File

@ -25,9 +25,9 @@ def chartVersions():
return render_template('chartRevisionList.html', table=table)
@routes.route('/nsLookup/<tiller_ns>/<namespace>')
def namespaceLookup(tiller_ns, namespace):
charts = get_charts(tiller_ns, namespace)
@routes.route('/nsLookup/<ns>/<namespace>')
def namespaceLookup(ns):
charts = get_charts(ns)
return jsonify(charts)
@routes.route('/deployChartRevision/<revision>/<chart>/<tiller_ns>', methods=['POST'])