Ready to perform helm command

This commit is contained in:
jenkins-x-bot 2020-09-13 23:39:23 +08:00
parent a1db290bd3
commit d9de373d3c
4 changed files with 12 additions and 6 deletions

View File

@ -63,7 +63,9 @@ def get_chartdata(namespace, chart):
raise err raise err
info(f"Output from command:\n{output}") info(f"Output from command:\n{output}")
data = json.loads(output) data = json.loads(output)
print(data) for revision in data:
revision["namespace"] = namespace
print(data[0])
return data return data
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -18,11 +18,10 @@ def chartVersions():
namespace = request.form['namespace'] namespace = request.form['namespace']
chart = request.form['chart'] chart = request.form['chart']
chartVersions = get_chartdata(namespace, chart) chartVersions = get_chartdata(namespace, chart)
print(chartVersions)
table = chartVersionTable(chartVersions) table = chartVersionTable(chartVersions)
table.border = True table.border = True
table.classes = ['table-striped', 'table-condensed', 'table-hover'] table.classes = ['table-striped', 'table-condensed', 'table-hover']
return render_template('chartRevisionList.html', table=table, namespace=namespace, chart=chart) return render_template('chartRevisionList.html', table=table, namespace=namespace)
@routes.route('/nsLookup/<namespace>') @routes.route('/nsLookup/<namespace>')
@ -30,7 +29,10 @@ def namespaceLookup(namespace):
charts = get_charts(namespace) charts = get_charts(namespace)
return jsonify(charts) return jsonify(charts)
@routes.route('/deployChartRevision/<revision>') @routes.route('/deployChartRevision/<revision>/<chart>/<namespace>', methods=['POST'])
def deployChartRevision(revision): def deployChartRevision(revision, chart, namespace):
print(revision)
print(chart)
print(namespace)
charts = get_charts(namespace) charts = get_charts(namespace)
return jsonify(charts) return jsonify(charts)

View File

@ -4,7 +4,8 @@ class chartVersionTable(Table):
revision = Col('Chart Revision') revision = Col('Chart Revision')
updated = Col('Updated') updated = Col('Updated')
status = Col('Status') status = Col('Status')
namespace = Col('Namespace')
chart = Col('Chart Version') chart = Col('Chart Version')
app_version = Col('Application Version') app_version = Col('Application Version')
description = Col('Description') description = Col('Description')
deploy = ButtonCol('Deploy', 'routes.deployChartRevision', url_kwargs=dict(revision='revision'), button_attrs={"type" : "submit", "class" : "btn btn-danger"}) deploy = ButtonCol('Deploy', 'routes.deployChartRevision', url_kwargs=dict(revision='revision', chart='chart', namespace='namespace'), button_attrs={"type" : "submit", "class" : "btn btn-danger"})

View File

@ -20,6 +20,7 @@
{% endwith %} {% endwith %}
</p> </p>
<table class="table table-bordered"> <table class="table table-bordered">
<input id="namespace" name="namespace" type="hidden" value="{{ namespace }}">
{{ table }} {{ table }}
</table> </table>
<a class="btn btn-primary" href="/" role="button">Home</a> <a class="btn btn-primary" href="/" role="button">Home</a>