Closed aschleck closed 2 years ago
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.
It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Welcome @aschleck!
It looks like this is your first PR to kubernetes-client/python-base 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-client/python-base has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
I believe I've signed the CLA
kubernetes/config -> base/config (https://github.com/kubernetes-client/python/blob/master/kubernetes/config), kubernetes/config is a link to base/config, so kubernetes.config.kube_config.ExecProvider is the ExecProvider in this PR.
could you add tests to verify the fix works?
Sorry I am not very clear on the workflow with this repository. When making this PR I cloned python-base/ only, are you saying that I should I clone the python/ repository as a whole and then somehow make the PR by modifying the submodule?
When I looked into adding tests for kube_config.py, it seemed difficult because the existing ExecProvider tests don't actually test anything about the ExecProvider. Would the best thing be to see if I can add a side-effect to the run() invocation and maybe be able to verify the property is set correctly? Are there better ways? Obviously I already added tests for the ExecProvider itself.
this PR is fine, no need to create a new PR. when you try to run the tests locally, you may need to clone the python repo with the base submodule.
since kube_config_test is a unittest, i think it is fine to do what you suggested, i.e. add a side-effect to the run() invocation and verify the property is set correctly
Added a test to kube_config_test.py
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: aschleck, yliaog
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
/kind bug
What this PR does / why we need it:
Kubeconfigs with exec specifications should invoke them so that referenced relative paths are relative to the config itself: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#file-references . The current implementation in this library does not do so, so this PR fixes it.
I am not sure how to fix the config/kube_config_test.py tests because they patch
kubernetes.config.kube_config.ExecProvider
rather than theExecProvider
implementation in this PR, and for a similar reason I suspect the currentfrom kubernetes.config.exec_provider import ExecProvider
inconfig/kube_config.py
will cause problems. But once this submodule is updated I think this should work fine, so not sure if there's anything I need to do.Which issue(s) this PR fixes:
I didn't find a filed bug about this.
Does this PR introduce a user-facing change?