Skip to content

Commit c59dab5

Browse files
fix(users): fix get_cluster logic
changed the get cluster logic to reflect the new volume mounts added References RHOAIENG-4028
1 parent 47ea469 commit c59dab5

File tree

4 files changed

+216
-25
lines changed

4 files changed

+216
-25
lines changed

src/codeflare_sdk/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
CodeFlareClusterStatus,
1212
RayCluster,
1313
AppWrapper,
14+
get_cluster,
1415
)
1516

1617
from .job import JobDefinition, Job, DDPJobDefinition, DDPJob, RayJobClient

src/codeflare_sdk/cluster/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
AppWrapper,
1414
)
1515

16-
from .cluster import Cluster, ClusterConfiguration
16+
from .cluster import Cluster, ClusterConfiguration, get_cluster
1717

1818
from .awload import AWManager

src/codeflare_sdk/cluster/cluster.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,12 @@ def from_k8_cluster_object(
510510
if "orderedinstance" in rc["metadata"]["labels"]
511511
else []
512512
)
513-
local_interactive = (
514-
"volumeMounts"
515-
in rc["spec"]["workerGroupSpecs"][0]["template"]["spec"]["containers"][0]
516-
)
513+
for volume in rc["spec"]["workerGroupSpecs"][0]["template"]["spec"]["volumes"]:
514+
if volume["name"] == "ca-vol":
515+
local_interactive = True
516+
break
517+
else:
518+
local_interactive = False
517519
if local_interactive:
518520
ingress_domain = get_ingress_domain_from_client(
519521
rc["metadata"]["name"], rc["metadata"]["namespace"]

0 commit comments

Comments
 (0)