Skip to content

Commit c30f747

Browse files
Fix Dashboard URI returned by cluster.status()
1 parent 1677680 commit c30f747

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/codeflare_sdk/cluster/cluster.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ def cluster_dashboard_uri(self) -> str:
310310

311311
for route in routes["items"]:
312312
if route["metadata"]["name"] == f"ray-dashboard-{self.config.name}":
313-
return f"http://{route['spec']['host']}"
313+
protocol = "https" if route["spec"].get("tls") else "http"
314+
return f"{protocol}://{route['spec']['host']}"
314315
return "Dashboard route not available yet, have you run cluster.up()?"
315316

316317
def list_jobs(self) -> List:
@@ -585,7 +586,8 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]:
585586
ray_route = None
586587
for route in routes["items"]:
587588
if route["metadata"]["name"] == f"ray-dashboard-{rc['metadata']['name']}":
588-
ray_route = route["spec"]["host"]
589+
protocol = "https" if route["spec"].get("tls") else "http"
590+
ray_route = f"{protocol}://{route['spec']['host']}"
589591

590592
return RayCluster(
591593
name=rc["metadata"]["name"],

0 commit comments

Comments
 (0)