-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tickets/DM-34218: expand user reset env beyond .local #133
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5393578
Replace clear_dotlocal with reset_user_env
athornton 9560879
Refresh JH to 2.2.2
athornton 9773ef8
reword reset box
athornton bdf618f
Use upstream kubespawner
athornton 45ee55a
Update black version
athornton dd60942
add type hints to shared_clients
athornton 34df669
Remove attribute for API client
athornton 0d88dc9
Use already-extant spawner's api object and its api_client attr
athornton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you show me the error message that you get if you don't do this? I've read the relevant source code for both kubespawner and kubernetes_asyncio and can't find any reason why this would be necessary. The kubernetes_asyncio ApiClient object has a
sanitize_for_serialization
method that's an entirely normal method and doesn't use anapi_client
attribute of itself in any way, andshared_client("ApiClient")
should just return a kubernetes_asyncio ApiClient. And you don't seem to have to do this down below in the code that's making actual Kubernetes calls. I also don't see anything like this code in kubespawner with a search.So I'm fairly confused, and the commit message and comment didn't really help unconfuse me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that the shared_client's
close_client_task()
uses anasync with
on theapi_client
attr of the client object to do its thing and cleanly shut down the shared client when it goes out of scope (that is, when the Spawner object is finalized).client objects that point to actual K8s APIs (e.g. CoreV1AP1) have such an attr. shared_client("ApiClient") does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jupyterhub/kubespawner#602
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! The problem is that
shared_client("ApiClient")
is simply invalid; the only thing that should be retrieved viashared_client
are specific API clients. That makes sense. I think the fix is to replace every instance ofapi_client = shared_client("ApiClient")
with:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better still: I already have one of those, because I have a spawner everywhere I use that client, and its api attr is already a CoreV1Api shared client.