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

update 'update-codegen.sh' to make it works outside GOPATH #481

Merged
merged 1 commit into from Feb 3, 2023

Conversation

zwpaper
Copy link
Member

@zwpaper zwpaper commented Jan 24, 2023

Signed-off-by: Wei Zhang kweizh@gmail.com

What type of PR is this?

/kind bug

What this PR does / why we need it:

b5ea0f1#diff-149dfe7bb29d1191dceae3a52915e750e64b7f87257a5fb309c29d3056e2a95d This commit previously deleted the generate-group.sh, but then can not gen clientset, informers and listers.

this PR:

  1. added the generate-group.sh back to generate clientset, informers, listers for scheduler-plugins
  2. bump controller gen to v0.11.1 to match https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/hack/verify-crdgen.sh#L30
  3. add output-base for codegen to make it works outside GOPATH

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

ref: kubernetes-sigs/kwok#226

Does this PR introduce a user-facing change?


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 24, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @zwpaper!

It looks like this is your first PR to kubernetes-sigs/scheduler-plugins 🎉. 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-sigs/scheduler-plugins 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. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 24, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @zwpaper. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 24, 2023
@Huang-Wei
Copy link
Contributor

@zwpaper thanks for the PR, but I cannot merge as-is now.

There is a history for b5ea0f1#diff-149dfe7bb29d1191dceae3a52915e750e64b7f87257a5fb309c29d3056e2a95d. Given it's pretty common for scheduler plugins to manipulate CR objects, and more important, different CR objects. So it makes a lot of sense to not use generated clients (the traditional k/k way); instead, leverage controller-runtime and follow kubebuilder's annotation syntac to use general (dynamic) client to manipulate the CR objects. However, that migration (from static clients to controller-runtime's client) is half-way done due to lack of volunteers. We need to finish it up sometime so we don't need static clients anymore.

@zwpaper
Copy link
Member Author

zwpaper commented Jan 25, 2023

Hi @Huang-Wei, got it! as for the volunteers part, where can I dig deeper into the controller-runtime topic? I would like to contribute to it, I used the operator from time to time, and maybe there is something I could help with.

@Huang-Wei
Copy link
Contributor

Hi @Huang-Wei, got it! as for the volunteers part, where can I dig deeper into the controller-runtime topic? I would like to contribute to it, I used the operator from time to time, and maybe there is something I could help with.

I need to take a look at the codebase first.. to see where we were left at. And then come up with a plan to work on the migration. Stay tuned.

Signed-off-by: Wei Zhang <kweizh@gmail.com>
@zwpaper
Copy link
Member Author

zwpaper commented Jan 26, 2023

Hi @Huang-Wei, I have updated the PR, and deleted the generated clientset related parts.

it is still necessary to do this fix because we still need update-internal-group.sh to generate deepcopy,defaults,conversion, and it should work outside GOPATH after this PR get merged.

also, I have updated the controller-gen to 0.11.1 to match https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/hack/verify-crdgen.sh?rgh-link-date=2023-01-24T09%3A50%3A10Z#L30

@zwpaper
Copy link
Member Author

zwpaper commented Jan 26, 2023

as for the controller runtime part, I will dig into the code base before your plan is ready😁

@zwpaper zwpaper changed the title add gen group back to gen clientset update update codegen to make it works outside GOPATH Jan 26, 2023
@zwpaper zwpaper changed the title update update codegen to make it works outside GOPATH update 'update-codegen.sh' to make it works outside GOPATH Jan 26, 2023
@zwpaper
Copy link
Member Author

zwpaper commented Jan 26, 2023

happened to find this PR may fix #445 as it failed due to not putting scheduler-plugins under GOPATH

@Huang-Wei
Copy link
Contributor

I have updated the PR, and deleted the generated clientset related parts.

Thanks. The current state looks good.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 31, 2023
@Huang-Wei
Copy link
Contributor

/lgtm
/approve
/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 3, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei, zwpaper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2023
@k8s-ci-robot k8s-ci-robot merged commit f996e5c into kubernetes-sigs:master Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants