Skip to content

Commit bece39c

Browse files
Added logic for getting clusters with routes
1 parent 56c1d12 commit bece39c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/codeflare_sdk/cluster/cluster.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ def get_cluster(cluster_name: str, namespace: str = "default"):
691691
config_check()
692692
api_instance = client.NetworkingV1Api(api_config_handler())
693693
ingresses = api_instance.list_namespaced_ingress(namespace)
694+
ingress_host = None
694695
if mcad == True:
695696
for ingress in ingresses.items:
696697
# Search for ingress with AppWrapper name as the owner
@@ -705,7 +706,11 @@ def get_cluster(cluster_name: str, namespace: str = "default"):
705706
return _kube_api_error_handling(e)
706707

707708
# We gather the ingress domain from the host
708-
ingress_domain = ingress_host.split(".", 1)[1]
709+
if ingress_host is not None:
710+
ingress_domain = ingress_host.split(".", 1)[1]
711+
else:
712+
ingress_domain = None
713+
709714
return Cluster.from_k8_cluster_object(
710715
rc, mcad=mcad, ingress_domain=ingress_domain
711716
)

0 commit comments

Comments
 (0)