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
Code generation outside GOPATH #106964
Code generation outside GOPATH #106964
Conversation
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Oof. I have not visited this in a while. Will look. |
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!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncdc, thockin 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 |
/retest |
1 similar comment
/retest |
/triage accepted |
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor to pull in the fix, update our script to use the `--trim-path-prefix` flag, and check in the resulting incidental deltas to generated files. HIVE-1723
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
kubernetes/kubernetes#106964 fixed a bug whereby codegen outside of GOPATH would put generated files under github.com/ relative to the repo root. Revendor k8s.io/code-generator to pull in the fix and update our script to use the --trim-path-prefix flag it introduced. The update resulted in dependency hell, including needing to move to go 1.17. Changes in actual hive code to accommodate updated dependencies include: - Accommodate a new method on workqueue.Interface. - Remove the `--v` flag from the hiveadmission executable -- logging-related CLI options were removed from the underlying command at some point. - Rewrite the logr wrapper we pass to controller-runtime to initialize the managers for the operator and controllers - Repoint where we get our fake clock from for testing expectations. HIVE-1723 HIVE-1753
/kind cleanup
What this PR does / why we need it:
Add support for the generators in k8s.io/code-generator to output generated files anywhere and not just in GOPATH.
The updated version of k8s.io/gengo now supports a
--trim-path-prefix
flag to trim a prefix from a generated file's path before creating it. This can be passed to thegenerate-groups.sh
script in k8s.io/code-generator. For example, if you're generating code for github.com/foo/bar, and you have it cloned somewhere not in GOPATH, you can do this:and the generated files will essentially be written relative to the current directory (assuming it's the root of your repo). So github.com/foo/bar/pkg/client will be written to just pkg/client/... and so on.
Which issue(s) this PR fixes:
Fixes kubernetes/code-generator#133
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: