Skip to content

Commit d8d9217

Browse files
[SSH] Fix SSH with SSO (#7861)
* Fix ssh. * Update sky/templates/websocket_proxy.py Co-authored-by: Seung Jin <[email protected]> --------- Co-authored-by: Seung Jin <[email protected]>
1 parent 088040e commit d8d9217

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

sky/templates/websocket_proxy.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,16 @@ async def websocket_to_stdout(websocket: ClientConnection,
237237
# TODO(aylei): Remove this after 0.10.0
238238
server_url = f'http://{server_url}'
239239

240-
health_url = f'{server_url}/api/health'
241-
health_response = requests.get(health_url)
242-
health_data = health_response.json()
243-
timestamps_are_supported = int(health_data['api_version']) > 21
244240
disable_latency_measurement = os.environ.get(
245241
skylet_constants.SSH_DISABLE_LATENCY_MEASUREMENT_ENV_VAR, '0') == '1'
246-
timestamps_are_supported = (timestamps_are_supported and
247-
not disable_latency_measurement)
242+
if disable_latency_measurement:
243+
timestamps_are_supported = False
244+
else:
245+
health_url = f'{server_url}/api/health'
246+
cookie_hdr = _get_cookie_header(health_url)
247+
health_response = requests.get(health_url, headers=cookie_hdr)
248+
health_data = health_response.json()
249+
timestamps_are_supported = int(health_data.get('api_version', 0)) > 21
248250

249251
server_proto, server_fqdn = server_url.split('://')
250252
websocket_proto = 'ws'

0 commit comments

Comments
 (0)