Skip to content
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

Add Dynamic Client support #260

Merged
merged 16 commits into from
Jul 2, 2023
Merged

Add Dynamic Client support #260

merged 16 commits into from
Jul 2, 2023

Conversation

bobh66
Copy link
Contributor

@bobh66 bobh66 commented Jun 3, 2023

Ported the DynamicClient from the synchronous kubernetes client and converted to async. Included docs and examples.

Fixes #209

dylex added a commit to flatironinstitute/binderhub that referenced this pull request Jun 3, 2023
- remove delete_user_pvc, now handled by kubespawner
- increase user cull timeout to a month
- temporarily disable monitor until tomplus/kubernetes_asyncio#260
Copy link
Owner

@tomplus tomplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive! Thanks for you contribution.


# Use field selector to query for named instance so the watch parameter is handled properly.
if name:
field_selector = f"metadata.name={name}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also pulled in the changes from this PR - kubernetes-client/python#2076 - to fix an issue with watching resources by name with the dynamic client.

@tomplus
Copy link
Owner

tomplus commented Jul 1, 2023

Looks good to me.

There is a minor issue in e2e tests, could you fix it? Thanks.

Signed-off-by: Bob Haddleton <[email protected]>
@tomplus
Copy link
Owner

tomplus commented Jul 2, 2023

Sorry for bothering you again, now flak8 complains...

Signed-off-by: Bob Haddleton <[email protected]>
@bobh66
Copy link
Contributor Author

bobh66 commented Jul 2, 2023

Sorry for bothering you again, now flak8 complains...

Sorry, I should have caught those. Hopefully all is good now.

Signed-off-by: Bob Haddleton <[email protected]>
@codecov
Copy link

codecov bot commented Jul 2, 2023

Codecov Report

Patch coverage: 22.51% and project coverage change: -0.01 ⚠️

Comparison is base (04f1d0f) 24.67% compared to head (d5e0869) 24.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
- Coverage   24.67%   24.66%   -0.01%     
==========================================
  Files         728      736       +8     
  Lines       97998    99024    +1026     
==========================================
+ Hits        24178    24429     +251     
- Misses      73820    74595     +775     
Impacted Files Coverage Δ
kubernetes_asyncio/e2e_test/test_dynamic_client.py 0.00% <0.00%> (ø)
kubernetes_asyncio/dynamic/client_test.py 13.79% <13.79%> (ø)
kubernetes_asyncio/dynamic/client.py 22.22% <22.22%> (ø)
kubernetes_asyncio/dynamic/discovery.py 22.56% <22.56%> (ø)
kubernetes_asyncio/dynamic/resource.py 25.64% <25.64%> (ø)
kubernetes_asyncio/dynamic/discovery_test.py 35.48% <35.48%> (ø)
kubernetes_asyncio/dynamic/exceptions.py 51.06% <51.06%> (ø)
kubernetes_asyncio/dynamic/__init__.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@tomplus tomplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

@tomplus tomplus merged commit 4695715 into tomplus:master Jul 2, 2023
@Jean-Daniel
Copy link
Contributor

Just a nitpick, but I think this commit misses a require change in setup.py.
As it adds a new package, it should be append in the setup.py package list.
the dynamic package it currently ignored by deployment tools like pip.

@tomplus
Copy link
Owner

tomplus commented Aug 1, 2023

@Jean-Daniel You are right, thanks! Do you want to submit PR for it?

@bobh66
Copy link
Contributor Author

bobh66 commented Aug 1, 2023

Should it also be added to kubernetes_asyncio/__init__.py?

https://github.com/tomplus/kubernetes_asyncio/blob/master/kubernetes_asyncio/__init__.py

@tomplus
Copy link
Owner

tomplus commented Aug 2, 2023

@bobh66 yes, it'd be beneficial.

@Jean-Daniel
Copy link
Contributor

@Jean-Daniel You are right, thanks! Do you want to submit PR for it?

PR submitted: #266

@bobh66
Copy link
Contributor Author

bobh66 commented Aug 16, 2023

Hi @tomplus - any chance we could get a release with these changes? Happy to help if there is anything I can do. Thanks!

@tomplus
Copy link
Owner

tomplus commented Aug 17, 2023

Sorry for the inconvenience, I'm going to release it over the weekend.

@tomplus
Copy link
Owner

tomplus commented Aug 21, 2023

It's been just released, v25.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamic.DynamicClient
3 participants