jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.56k stars 390 forks source link

Move pod quota checking into separate class #1526

Closed manics closed 2 years ago

manics commented 2 years ago

Whilst working on https://github.com/jupyterhub/binderhub/pull/1521 I realised the Kubernetes client is still used a few places.

This moves the quota checking code from builder.BuildHandler.launch into it's own class. The logic should be unchanged.

After this the remaining use of the kubernetes_client is in the health check: https://github.com/jupyterhub/binderhub/blob/656204bb62d46be51fc7fb79cc5d7600b71a7614/binderhub/health.py#L108-L113

Note I haven't tested this on a real system yet.