-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
What broke? What's expected?
We use a replacement in go.mod for sigs.k8s.io/controller-runtime and k8s.io/api.
When running a make test in a kubebuilder generating project, the ENVTEST_VERSION and ENVTEST_K8S_VERSION values are taken from the original go versions, rather than being replaced.
Reproducing this issue
Create basic kubebuilder project. Edit go/mod and replace sigs.k8s.io/controller-runtime and k8s.io/api component versions.
The main problem of this issue, that go list -m -f "{{ .Version }}" k8s.io/api
command in Makefile doesn't utilize replace info in this manner. Seems to command should be like this
go list -m k8s.io/api | rev | cut -d' ' -f1 | rev | awk -F'[v.]' '{printf "1.%d", $$3}
Or can be optimized a bit with raw awk code, like
go list -m k8s.io/api | awk '{print $$NF}' | awk -F'[v.]' '{printf "1.%d", $$3}
KubeBuilder (CLI) Version
4.6.0
PROJECT version
3
Plugin versions
Other versions
No response
Extra Labels
No response
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.