@@ -151,7 +151,9 @@ def down(self):
151
151
)
152
152
# Delete the ingress
153
153
api_instance = client .NetworkingV1Api (api_config_handler ())
154
- api_instance .delete_namespaced_ingress (name = f"ray-dashboard-{ self .config .name } " , namespace = namespace )
154
+ api_instance .delete_namespaced_ingress (
155
+ name = f"ray-dashboard-{ self .config .name } " , namespace = namespace
156
+ )
155
157
except Exception as e : # pragma: no cover
156
158
return _kube_api_error_handling (e )
157
159
@@ -266,11 +268,13 @@ def cluster_dashboard_uri(self) -> str:
266
268
ingresses = api_instance .list_namespaced_ingress (self .config .namespace )
267
269
except Exception as e :
268
270
return _kube_api_error_handling (e )
269
-
271
+
270
272
for ingress in ingresses .items :
271
273
if (
272
274
ingress .metadata .name == f"ray-dashboard-{ self .config .name } "
273
- and ingress .spec .rules [0 ].host .startswith (f"ray-dashboard-{ self .config .name } " )
275
+ and ingress .spec .rules [0 ].host .startswith (
276
+ f"ray-dashboard-{ self .config .name } "
277
+ )
274
278
):
275
279
return f"http://{ ingress .spec .rules [0 ].host } "
276
280
return "Dashboard route not available yet, have you run cluster.up()?"
@@ -362,6 +366,7 @@ def local_client_url(self):
362
366
else :
363
367
return "None"
364
368
369
+
365
370
def create_ingress (self ):
366
371
"""
367
372
Create a Kubernetes Ingress resource to expose the Ray dashboard service externally.
@@ -409,6 +414,7 @@ def create_ingress(self):
409
414
except Exception as e :
410
415
return _kube_api_error_handling (e )
411
416
417
+
412
418
def list_all_clusters (namespace : str , print_to_console : bool = True ):
413
419
"""
414
420
Returns (and prints by default) a list of all clusters in a given namespace.
@@ -590,8 +596,6 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]:
590
596
for ingress in ingresses .items :
591
597
if ingress .metadata .name == f"ray-dashboard-{ rc ['metadata' ]['name' ]} " :
592
598
ray_route = ingress .spec .rules [0 ].host
593
-
594
-
595
599
596
600
return RayCluster (
597
601
name = rc ["metadata" ]["name" ],
0 commit comments