Closed tyama711 closed 1 year ago
Welcome @tyama711!
It looks like this is your first PR to kubernetes-client/gen 🎉. 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/gen 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:
Thanks for the PR.
Don't we want to run this same sed
command on the custom directory also?
@brendandburns Thank you for your comment.
I thought that the sed command was only necessary when python.sh is used for generating source code in the kubernetes-client/python repository, and that it would not be necessary for users who generate code independent of the kubernetes-client/python repository, such as when python.sh is executed from python-crd-cmd.sh. Therefore, I modified the script to only run sed when PACKAGE_NAME is "client".
Should the sed command always be executed? If so, I will make the necessary changes.
I was thinking that this was rewriting imports for things like the V1Metadata which is in the Kubernetes client package, but perhaps I was wrong?
Does the generated client work for you without the sed ...
commands?
cc @roycaihw to see what he thinks since he is more of a Python client expert than I am.
This sed command is executed to replace, for example,
from client.configuration import Configuration
with
from kubernetes.client.configuration import Configuration
as seen in https://github.com/kubernetes-client/python/blob/master/kubernetes/client/api_client.py#L27.
In my use case where I want to generate client code for my own CRD, this process is not necessary and the script works fine without it.
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: brendandburns, tyama711
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Good enough for me :)
When executing
python-crd-cmd.sh
with the-n
option specifying the package name, an error occurs as shown below:This is because the
client
directory is not created when the-n
option is explicitly specified (client
is the default value of the-n
option). I fixed the error by checking package name before thefind
command.