Skip to content

Commit cde448d

Browse files
authored
[UI] logs for clusters where teamId has dash (#1859)
* [UI] logs for clusters where teamId has dash
1 parent 532772c commit cde448d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

ui/operator_ui/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,13 @@ def get_operator_get_logs(worker: int):
961961
@app.route('/operator/clusters/<namespace>/<cluster>/logs')
962962
@authorize
963963
def get_operator_get_logs_per_cluster(namespace: str, cluster: str):
964-
team, clustername = cluster.split('-', 1)
965-
return proxy_operator(f'/clusters/{team}/{namespace}/{clustername}/logs/')
964+
user_teams = get_teams_for_user(session.get('user_name', ''))
965+
for user_team in user_teams:
966+
if cluster.find(user_team) == 0:
967+
team = cluster[:len(user_team)]
968+
cluster_name = cluster[len(user_team)+1:]
969+
break
970+
return proxy_operator(f'/clusters/{team}/{namespace}/{cluster_name}/logs/')
966971

967972

968973
@app.route('/login')

ui/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
Flask-OAuthlib==0.9.5
2-
Flask==1.1.2
1+
Flask-OAuthlib==0.9.6
2+
Flask==2.1.0
33
backoff==1.10.0
44
boto3==1.16.52
55
boto==2.49.0
6-
click==7.1.2
6+
click==8.1.2
77
furl==2.1.0
88
gevent==20.12.1
9-
jq==1.1.1
9+
jq==1.2.2
1010
json_delta>=2.0
1111
kubernetes==3.0.0
1212
requests==2.25.1
1313
stups-tokens>=1.1.19
1414
wal_e==1.1.1
15-
werkzeug==0.16.1
15+
werkzeug==2.1.1

0 commit comments

Comments
 (0)