Skip to content

Commit 8da69f2

Browse files
committed
fix total pod count
pod_quota was not being enforced because total_pods was not the number of pods, but the number of keys in the response dict (4).
1 parent b10a3d7 commit 8da69f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

binderhub/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ async def launch(self, provider):
537537
_preload_content=False,
538538
)
539539
resp = await asyncio.wrap_future(f)
540-
pods = json.loads(resp.read())
540+
pods = json.loads(resp.read())["items"]
541541
total_pods = len(pods)
542542

543543
if pod_quota is not None and total_pods >= pod_quota:
@@ -550,7 +550,7 @@ async def launch(self, provider):
550550
await self.fail("Too many users on this BinderHub! Try again soon.")
551551
return
552552

553-
for pod in pods["items"]:
553+
for pod in pods:
554554
for container in pod["spec"]["containers"]:
555555
# is the container running the same image as us?
556556
# if so, count one for the current repo.

0 commit comments

Comments
 (0)