-
Notifications
You must be signed in to change notification settings - Fork 415
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
Allow to use the code-gen in vendorless projects #163
Comments
/assign |
It might be possible already |
Yes, the specific generators are separate commands: https://github.com/kubernetes/code-generator/tree/master/cmd However, this issue is about the shell wrapper files:
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
Now that Go workspaces has landed in k/k, two things are changed:
I'd prefer we obviate kube_codegen.sh rather than rewrite it. There are a few things that the kube_codegen.sh does that you would need to change to run the tools yourself. It does questionable |
thanks @thockin awesome work |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Should we close this now? |
/close Yes. Thanks |
@cardil: Closing this issue. In response to this:
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-sigs/prow repository. |
Background
At Knative project, we would like to get rid of the
vendor
directory (see knative/infra#134 for details). One of the things that block that is the extensive use of the Kubernetes code-generator, to be exact, the generate-groups.sh shell script.Recently, the shell code in the Kubernetes has been rewritten a bit in the right direction (kubernetes/kubernetes#117262).
However, it still depends on the non-go shell scripts as the entry points, thus still requiring the use of
vendor
in the code. The usage of shell scripts isn't cross-platform.Expected behavior
The Kubernetes code-gen should allow projects to leverage the
go run ...
syntax. With it, projects could use the code-gen even without any connection to Kuberentes code:Or by managing the code-gen version in the project's
go.mod
file:and then running withing that project (notice the lack of the package version):
Ideas
Refactor into an entry point binary.
The K8s code-gen already has multiple binaries in the
cmd/
directory, but we could add the entry pointcode-gen
binary there, that will directly support the same arguments as the current kube_codegen.sh script. This approach is cross-platform.Embed the shell script in Go
An easier solution would be to use an approach similar to knative/hack#222, so embedding the shell scripts into Go code (with
//go:embed
feature), and extracting it into sometmp/
directory.The text was updated successfully, but these errors were encountered: