Skip to content

Commit

Permalink
Fix loadBalancer attribute name
Browse files Browse the repository at this point in the history
Closes #906
  • Loading branch information
catzc committed Sep 17, 2024
1 parent 2ecfdcd commit 893bee7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dask_kubernetes/operator/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ async def daskcluster_create_components(
await worker_group.create()
logger.info(f"Worker group {data['metadata']['name']} created in {namespace}.")

patch.status["phase"] = "Pending"
patch.status["phase"] = "Running"


@kopf.on.field("service", field="status", labels={"dask.org/component": "scheduler"})
Expand All @@ -401,7 +401,7 @@ async def handle_scheduler_service_status(
assert namespace
# If the Service is a LoadBalancer with no ingress endpoints mark the cluster as Pending
if spec["type"] == "LoadBalancer" and not len(
status.get("load_balancer", {}).get("ingress", [])
status.get("loadBalancer", {}).get("ingress", [])
):
phase = "Pending"
# Otherwise mark it as Running
Expand Down
4 changes: 2 additions & 2 deletions dask_kubernetes/operator/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ async def get_external_address_for_scheduler_service(
"""Take a service object and return the scheduler address."""
if service.spec.type == "LoadBalancer":
port = _get_port(service, port_name)
lb = service.status.load_balancer.ingress[0]
host = lb.hostname or lb.ip
lb = service.status.loadBalancer.ingress[0]
host = lb.get('hostname', None) or lb.ip
elif service.spec.type == "NodePort":
port = _get_port(service, port_name, is_node_port=True)
nodes = await kr8s.asyncio.get("nodes")
Expand Down

0 comments on commit 893bee7

Please sign in to comment.