Skip to content

Commit 893bee7

Browse files
committed
Fix loadBalancer attribute name
Closes #906
1 parent 2ecfdcd commit 893bee7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dask_kubernetes/operator/controller/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ async def daskcluster_create_components(
387387
await worker_group.create()
388388
logger.info(f"Worker group {data['metadata']['name']} created in {namespace}.")
389389

390-
patch.status["phase"] = "Pending"
390+
patch.status["phase"] = "Running"
391391

392392

393393
@kopf.on.field("service", field="status", labels={"dask.org/component": "scheduler"})
@@ -401,7 +401,7 @@ async def handle_scheduler_service_status(
401401
assert namespace
402402
# If the Service is a LoadBalancer with no ingress endpoints mark the cluster as Pending
403403
if spec["type"] == "LoadBalancer" and not len(
404-
status.get("load_balancer", {}).get("ingress", [])
404+
status.get("loadBalancer", {}).get("ingress", [])
405405
):
406406
phase = "Pending"
407407
# Otherwise mark it as Running

dask_kubernetes/operator/networking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ async def get_external_address_for_scheduler_service(
5050
"""Take a service object and return the scheduler address."""
5151
if service.spec.type == "LoadBalancer":
5252
port = _get_port(service, port_name)
53-
lb = service.status.load_balancer.ingress[0]
54-
host = lb.hostname or lb.ip
53+
lb = service.status.loadBalancer.ingress[0]
54+
host = lb.get('hostname', None) or lb.ip
5555
elif service.spec.type == "NodePort":
5656
port = _get_port(service, port_name, is_node_port=True)
5757
nodes = await kr8s.asyncio.get("nodes")

0 commit comments

Comments
 (0)