@@ -487,8 +487,8 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
487
487
488
488
def get_cluster(cluster_name: str, namespace: str = "default"):
489
489
try:
490
- config.load_kube_config ()
491
- api_instance = client.CustomObjectsApi()
490
+ config_check ()
491
+ api_instance = client.CustomObjectsApi(api_config_handler() )
492
492
rcs = api_instance.list_namespaced_custom_object(
493
493
group="ray.io",
494
494
version="v1alpha1",
@@ -509,7 +509,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
509
509
# private methods
510
510
def _get_ingress_domain():
511
511
try:
512
- config.load_kube_config ()
512
+ config_check ()
513
513
api_client = client.CustomObjectsApi(api_config_handler())
514
514
ingress = api_client.get_cluster_custom_object(
515
515
"config.openshift.io", "v1", "ingresses", "cluster"
@@ -604,7 +604,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
604
604
605
605
606
606
def _map_to_ray_cluster(rc) -> Optional[RayCluster]:
607
- if "state" in rc["status"]:
607
+ if "status" in rc and " state" in rc["status"]:
608
608
status = RayClusterStatus(rc["status"]["state"].lower())
609
609
else:
610
610
status = RayClusterStatus.UNKNOWN
@@ -694,8 +694,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
694
694
</ summary >
695
695
< pre > < code class ="python "> def get_cluster(cluster_name: str, namespace: str = "default"):
696
696
try:
697
- config.load_kube_config ()
698
- api_instance = client.CustomObjectsApi()
697
+ config_check ()
698
+ api_instance = client.CustomObjectsApi(api_config_handler() )
699
699
rcs = api_instance.list_namespaced_custom_object(
700
700
group="ray.io",
701
701
version="v1alpha1",
0 commit comments