-
Notifications
You must be signed in to change notification settings - Fork 71
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
Added load_config
function
#331
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #331 +/- ##
==========================================
+ Coverage 28.16% 28.19% +0.02%
==========================================
Files 779 779
Lines 92200 92239 +39
==========================================
+ Hits 25965 26003 +38
- Misses 66235 66236 +1 ☔ View full report in Codecov by Sentry. |
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.
Thanks for you porting this code. It's definitely helpful in some use cases.
Could you add a simple test to be sure that the function is in place?
You can add something like this: https://github.com/tomplus/kubernetes_asyncio/blob/master/kubernetes_asyncio/config/kube_config_test.py#L950 but using the new function. Thanks.
Can do |
Unfortunately, the `load_incluster_config` function was difficult to test directly as it was as a few constants would have had to be monkeypatched. To make the function more testable, I made those constants configurable via kwargs.
Okay, after a bit of a slow down trying to write unit tests using The kube config test was fairly simple, but the incluster config test was a bit more challenging. The I also noticed that the version of |
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.
Thanks, looks good to me 👍
Pipelines reported an error, could you take a look?
Awh my bad, I was testing using Python 3.11 and the parentheses in It may be worth adding a tox.ini file in the future to make it easier to run tests across different Python versions. Let me know if that sounds like something you'd be interested in and I could perhaps put in a PR for it |
I removed tox.ini (#105), but now I agree it could be helpful. |
Added load config function from https://github.com/kubernetes-client/python/blob/master/kubernetes/base/config/__init__.py#L24. It was pretty much a drop-in copy and paste, aside from having to update the
load_kube_config
call to beawait
ed. I would have copied over any tests as well, but I did not find any. Please let me know if you would like to build some up out or if you'd like me to make any other updates!Fixes #249