Skip to content

Commit

Permalink
adding k3s latest for zack
Browse files Browse the repository at this point in the history
  • Loading branch information
clemenko committed Apr 17, 2024
1 parent 54a35c1 commit e4573d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dzver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def json_all_the_things():

k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '')

k3s_rke_out = json.dumps(k3s_data["data"][1]["latest"]).replace('"', '')

cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest", headers=headers).text)
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '')
Expand All @@ -38,7 +40,7 @@ def json_all_the_things():
hauler_data = json.loads(requests.get("https://api.github.com/repos/rancherfederal/hauler/releases/latest", headers=headers).text)
hauler_out = json.dumps(hauler_data["tag_name"]).replace('"', '')

return jsonify({'k3s': k3s_out, 'rke2 stable': rke_out, 'rke latest': late_rke_out, 'cert-manager': cert_out, 'rancher': rancher_out, 'longhorn': longhorn_out, 'neuvector': neuvector_out, 'harvester': harvester_out, 'hauler': hauler_out}), 200
return jsonify({'k3s stable': k3s_out, 'k3s latest': k3s_rke_out, 'rke2 stable': rke_out, 'rke latest': late_rke_out, 'cert-manager': cert_out, 'rancher': rancher_out, 'longhorn': longhorn_out, 'neuvector': neuvector_out, 'harvester': harvester_out, 'hauler': hauler_out}), 200

@app.route('/', methods=['GET'])
def curl_all_the_things():
Expand All @@ -49,6 +51,8 @@ def curl_all_the_things():

k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '')

k3s_rke_out = json.dumps(k3s_data["data"][1]["latest"]).replace('"', '')

cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest", headers=headers).text)
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '')
Expand All @@ -68,7 +72,7 @@ def curl_all_the_things():
hauler_data = json.loads(requests.get("https://api.github.com/repos/rancherfederal/hauler/releases/latest", headers=headers).text)
hauler_out = json.dumps(hauler_data["tag_name"]).replace('"', '')

return render_template('index.html', rancher_ver=rancher_out, rke_ver=rke_out, late_rke_ver=late_rke_out, k3s_ver=k3s_out, longhorn_ver=longhorn_out, neu_ver=neuvector_out, cert_ver=cert_out, harv_ver=harvester_out, hauler_ver=hauler_out)
return render_template('index.html', rancher_ver=rancher_out, rke_ver=rke_out, late_rke_ver=late_rke_out, k3s_ver=k3s_out, late_k3s_ver=k3s_rke_out, longhorn_ver=longhorn_out, neu_ver=neuvector_out, cert_ver=cert_out, harv_ver=harvester_out, hauler_ver=hauler_out)

if __name__ == '__main__':
app.run(host='0.0.0.0',debug=False)
4 changes: 4 additions & 0 deletions dzver/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ <h2>Latest Rancher Stack Versions</h2>
<td>K3s - Stable</td>
<td>{{k3s_ver}}</td>
</tr>
<tr>
<td>K3s - Latest</td>
<td>{{late_k3s_ver}}</td>
</tr>
<tr>
<td>Rancher</td>
<td>{{rancher_ver}}</td>
Expand Down

0 comments on commit e4573d1

Please sign in to comment.