This document covers all breaking changes when migrating from projects built using the plugin go/v3 (default for any scaffold done since 28 Apr 2021
) to the next version of the Golang plugin go/v4
.
The details of all changes (breaking or otherwise) can be found in:
- controller-runtime
- controller-tools
- kustomize
- kb-releases release notes.
go/v4
projects use Kustomize v5x (instead of v3x)- note that some manifests under
config/
directory have been changed in order to no longer use the deprecated Kustomize features such as env vars. - A
kustomization.yaml
is scaffolded underconfig/samples
. This helps simply and flexibly generate sample manifests:kustomize build config/samples
. - adds support for Apple Silicon M1 (darwin/arm64)
- remove support to CRD/WebHooks Kubernetes API v1beta1 version which are no longer supported since k8s 1.22
- no longer scaffold webhook test files with
"k8s.io/api/admission/v1beta1"
the k8s API which is no longer served since k8s1.25
. By default webhooks test files are scaffolding using"k8s.io/api/admission/v1"
which is support from k8s1.20
- no longer provide backwards compatible support with k8s versions <
1.16
- change the layout to accommodate the community request to follow the Standard Go Project Layout
by moving the api(s) under a new directory called
api
, controller(s) under a new directory calledinternal
and themain.go
under a new directory namedcmd
Further details can be found in the go/v4 plugin section
More details on this can be found at here, but for the highlights, check below
After using the CLI to create your project, you are free to customize how you see fit. Bear in mind, that it is not recommended to deviate from the proposed layout unless you know what you are doing.
For example, you should refrain from moving the scaffolded files, doing so will make it difficult in upgrading your project in the future. You may also lose the ability to use some of the CLI features and helpers. For further information on the project layout, see the doc What's in a basic project?
If you want to upgrade your scaffolding to use the latest and greatest features then, follow the guide which will cover the steps in the most straightforward way to allow you to upgrade your project to get all latest changes and improvements.
- Migration Guide go/v3 to go/v4 (Recommended)
If you want to use the latest version of Kubebuilder CLI without changing your scaffolding then, check the following guide which will describe the steps to be performed manually to upgrade only your PROJECT version and start using the plugins versions.
This way is more complex, susceptible to errors, and success cannot be assured. Also, by following these steps you will not get the improvements and bug fixes in the default generated project files.