First install the setup-envtest tool:
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latestUse setup-envtest to download the Kubebuilder assets:
setup-envtest use -p path <version> Replace <version> with the Kubernetes version you want to test against, for
example, 1.31.x. The -p path flag will print the path where the assets are stored.
Set the KUBEBUILDER_ASSETS environment variable to the path printed by the previous
command:
export KUBEBUILDER_ASSETS=/path/to/kubebuilder/assetsYou may want to add this to your shells configuration file (e.g ~/.bashrc or ~/.zshrc)
to make it permanent.
make test WHAT=integrationIf you're still encountering issues, make sure the KUBEBUILDER_ASSETS environment variable
is correctly set and points to a directory containing the etcd binary.