Added helm2 specifics
This commit is contained in:
parent
17443ee1ea
commit
4b2dca4355
1
forms.py
1
forms.py
@ -7,7 +7,6 @@ from wtforms import validators, ValidationError
|
|||||||
from wtforms.validators import InputRequired, Email, Length
|
from wtforms.validators import InputRequired, Email, Length
|
||||||
from flask_bootstrap import Bootstrap
|
from flask_bootstrap import Bootstrap
|
||||||
|
|
||||||
|
|
||||||
class deploySelectForm(FlaskForm):
|
class deploySelectForm(FlaskForm):
|
||||||
tiller_ns = SelectField('tiller_ns', choices=[], coerce=str)
|
tiller_ns = SelectField('tiller_ns', choices=[], coerce=str)
|
||||||
namespace = SelectField('namespace', choices=[], coerce=str)
|
namespace = SelectField('namespace', choices=[], coerce=str)
|
||||||
|
|||||||
3
main.py
3
main.py
@ -69,7 +69,6 @@ def get_chartdata(tiller_ns, namespace, chart):
|
|||||||
command = "/usr/local/bin/helm --tiller-namespace " + tiller_ns + " history " + chart + " --output json" #helm2
|
command = "/usr/local/bin/helm --tiller-namespace " + tiller_ns + " history " + chart + " --output json" #helm2
|
||||||
#command = "/usr/local/bin/helm -n " + namespace + " history " + chart + " -ojson" #helm3
|
#command = "/usr/local/bin/helm -n " + namespace + " history " + chart + " -ojson" #helm3
|
||||||
info(f"Running command: {command}")
|
info(f"Running command: {command}")
|
||||||
print(f"Running command: {command}")
|
|
||||||
try:
|
try:
|
||||||
output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8")
|
output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8")
|
||||||
except CalledProcessError as err:
|
except CalledProcessError as err:
|
||||||
@ -79,7 +78,7 @@ def get_chartdata(tiller_ns, namespace, chart):
|
|||||||
data = json.loads(output)
|
data = json.loads(output)
|
||||||
for revision in data:
|
for revision in data:
|
||||||
revision["namespace"] = namespace
|
revision["namespace"] = namespace
|
||||||
print(data[0])
|
revision["tiller_ns"] = tiller_ns
|
||||||
return data
|
return data
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@ -26,15 +26,12 @@ def chartVersions():
|
|||||||
return render_template('chartRevisionList.html', table=table, namespace=namespace)
|
return render_template('chartRevisionList.html', table=table, namespace=namespace)
|
||||||
|
|
||||||
|
|
||||||
@routes.route('/nsLookup/<tiller>/<namespace>')
|
@routes.route('/nsLookup/<tiller>/<namespace>/<tiller_ns>')
|
||||||
def namespaceLookup(tiller, namespace):
|
def namespaceLookup(tiller, namespace, tiller_ns):
|
||||||
charts = get_charts(tiller, namespace)
|
charts = get_charts(tiller, namespace, tiller_ns)
|
||||||
return jsonify(charts)
|
return jsonify(charts)
|
||||||
|
|
||||||
@routes.route('/deployChartRevision/<revision>/<chart>/<namespace>', methods=['POST'])
|
@routes.route('/deployChartRevision/<revision>/<chart>/<namespace>/<tiller_ns>', methods=['POST'])
|
||||||
def deployChartRevision(revision, chart, namespace):
|
def deployChartRevision(revision, chart, namespace, tiller_ns):
|
||||||
print(revision)
|
charts = get_charts(tiller_ns, namespace)
|
||||||
print(chart)
|
|
||||||
print(namespace)
|
|
||||||
charts = get_charts(namespace)
|
|
||||||
return jsonify(charts)
|
return jsonify(charts)
|
||||||
|
|||||||
16
tables.py
16
tables.py
@ -1,11 +1,11 @@
|
|||||||
from flask_table import Table, Col, LinkCol, ButtonCol
|
from flask_table import Table, Col, LinkCol, ButtonCol
|
||||||
|
|
||||||
class chartVersionTable(Table):
|
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')
|
namespace = Col('Namespace')
|
||||||
Chart = Col('Chart Version')
|
tiller_ns = Col('Tiiler Namespace')
|
||||||
AppVersion = Col('Application Version')
|
chart = Col('Chart Version')
|
||||||
Description = Col('Description')
|
description = Col('Description')
|
||||||
deploy = ButtonCol('Deploy', 'routes.deployChartRevision', url_kwargs=dict(revision='Revision', chart='Chart', namespace='Namespace'), button_attrs={"type" : "submit", "class" : "btn btn-danger"})
|
deploy = ButtonCol('Deploy', 'routes.deployChartRevision', url_kwargs=dict(revision='revision', chart='chart', namespace='namespace', tiller_ns='tiller_ns'), button_attrs={"type" : "submit", "class" : "btn btn-danger"})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user