jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
615 stars 220 forks source link

change V1Subject to RbacV1Subject in k8s.py #1384

Open merqri opened 4 weeks ago

merqri commented 4 weeks ago

This change fix - Error: module 'kubernetes.client' has no attribute 'V1Subject'

This error occurs when an attempt is made to create a role binding. The full error looks as follows:

[E 2024-06-03 08:58:36.252 EnterpriseGatewayApp] Error occurred creating role binding for namespace 'jovyan-153ca7c1-c68f-440d-b678-f8926b48afbc': module 'kubernetes.client' has no attribute 'V1Subject'
welcome[bot] commented 4 weeks ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

kevin-bates commented 4 weeks ago

Hi @merqri and @fm2022aa. I'm curious why this hasn't always been an issue. Was there a version update that triggered this? Does this only occur under certain custom role configurations? (Sorry, been out of the loop for a while and would like to better understand what prompts this change.)

kevin-bates commented 4 weeks ago

Sorry, just caught up on #1379.

Since this appears to be due to version changes, do we need to concern ourselves with breaking older installations?

@lresende - looks like you had some thoughts on this (capping client?). Does that prevent use on newer versions of k8s like 1.30 (or even 1.29)?

lresende commented 4 weeks ago

Capping the client to 1.28 would make it work for current users, but would make it fail for users that have upgraded to >= 1.29 then... Another approach would be to try to check in the code for the current version and use one or the other.