go/v2 plugin has the purpose to scaffold Golang projects to help users to build projects with controllers and keep the backwards compatibility with the default scaffold made using Kubebuilder CLI
You can check samples using this plugin by looking at the
project-v2-<options> directories under the testdata projects on the root directory of the Kubebuilder project.
Only if you are looking to scaffold a project with the legacy layout. Otherwise, it is recommended you to use the default Golang version plugin.
To initialize a Golang project using the legacy layout and with this plugin run, e.g.:
kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project --plugins=go/v2
- Init -
kubebuilder init [OPTIONS]
- Edit -
kubebuilder edit [OPTIONS]
- Create API -
kubebuilder create api [OPTIONS]
- Create Webhook -
kubebuilder create webhook [OPTIONS]
- Check the code implementation of the go/v2 plugin.