✨ (go/v4): Pin the ENVTEST version in the scaffold, now supported starting with controller-runtime release v0.24.0#5684
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: v47 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @v47. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Because it is a change that impact end users we should use emoji ✨ |
There was a problem hiding this comment.
Pull request overview
This PR updates the go/v4 scaffold to make setup-envtest installation reproducible by pinning ENVTEST_VERSION to the full sigs.k8s.io/controller-runtime semver (instead of converting it to a moving release-x.y branch), and regenerates the affected testdata/docs Makefile snippets.
Changes:
- Update Makefile scaffolding logic to use the full controller-runtime module version for
ENVTEST_VERSION(norelease-x.yconversion). - Regenerate go/v4 testdata Makefiles to match the new envtest pinning behavior.
- Update docs snippets to show the pinned-semver
ENVTEST_VERSIONapproach.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go |
Switches ENVTEST_VERSION derivation from release-x.y to full semver for deterministic go install of setup-envtest. |
testdata/project-v4/Makefile |
Regenerated scaffold output reflecting the new ENVTEST_VERSION behavior. |
testdata/project-v4-with-plugins/Makefile |
Regenerated scaffold output reflecting the new ENVTEST_VERSION behavior. |
testdata/project-v4-multigroup/Makefile |
Regenerated scaffold output reflecting the new ENVTEST_VERSION behavior. |
docs/book/src/reference/envtest.md |
Updates the documented Makefile snippet to use the full controller-runtime semver for ENVTEST_VERSION. |
docs/book/src/reference/artifacts.md |
Updates the documented Makefile snippet to use the full controller-runtime semver for ENVTEST_VERSION. |
docs/book/src/getting-started/testdata/project/Makefile |
Regenerated tutorial testdata Makefile reflecting the new ENVTEST_VERSION behavior. |
docs/book/src/cronjob-tutorial/testdata/project/Makefile |
Regenerated tutorial testdata Makefile reflecting the new ENVTEST_VERSION behavior. |
docs/book/src/multiversion-tutorial/testdata/project/Makefile |
Regenerated tutorial testdata Makefile reflecting the new ENVTEST_VERSION behavior. |
| CONTROLLER_TOOLS_VERSION ?= {{ .ControllerToolsVersion }} | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) | ||
| ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime) |
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) | ||
| ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
| CONTROLLER_TOOLS_VERSION ?= v0.20.1 | ||
|
|
||
| #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) | ||
| #ENVTEST_VERSION is the version of controller-runtime to use for setup-envtest (i.e. v0.20.0) |
f79d08c to
c5e35f6
Compare
c5e35f6 to
6e639e6
Compare
6e639e6 to
a407366
Compare
Description:
Previously,
ENVTEST_VERSIONin the scaffoldedMakefilewas computed by stripping the patch version from thecontroller-runtimesemver and converting it to a release branch name (e.g.v0.20.1→release-0.20). This meantgo installresolved to whatever HEAD of that branch was at download time - not a reproducible, pinned version.Changes:
setup-envtestpublishes proper semver tags, the scaffold uses the full semver directly (e.g.v0.20.1), making builds reproducible andgo installfully deterministic.go/v4Makefile template and regenerates all affected testdata and docs sample projects.Fixes #5679