Skip to content

ci-integration.yml: setup-envtest pin does not resolve, breaking the envtest stage in every consumer #1

Description

@jacaudi

ci-integration.yml pins setup-envtest to a version that does not exist, so the Install setup-envtest step fails in every consumer that renders the envtest stage.

Reproduce

$ go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.22.1
go: downloading sigs.k8s.io/controller-runtime v0.22.1
go: sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.22.1: module
sigs.k8s.io/controller-runtime@v0.22.1 found, but does not contain package
sigs.k8s.io/controller-runtime/tools/setup-envtest

Cause

tools/setup-envtest is a separate Go module with its own tag line, not a package inside the main controller-runtime module. A controller-runtime version number is therefore never a valid version for it:

$ go list -m -versions sigs.k8s.io/controller-runtime/tools/setup-envtest
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.24.0 v0.24.1

The current source reads:

# renovate: datasource=go depName=sigs.k8s.io/controller-runtime
CR_VERSION: v0.22.1
run: go install "sigs.k8s.io/controller-runtime/tools/setup-envtest@${CR_VERSION}"

The variable name and the comment above it both suggest the pin is meant to track the controller-runtime library. It cannot — and the two are independent anyway. setup-envtest only downloads apiserver/etcd binaries; what has to match a consumer's client stack is the asset version (ENVTEST_K8S_VERSION), not the tool.

The renovate annotation compounds it: pointed at sigs.k8s.io/controller-runtime, it will keep proposing versions that cannot install.

Suggested fix

# renovate: datasource=go depName=sigs.k8s.io/controller-runtime/tools/setup-envtest
SETUP_ENVTEST_VERSION: v0.24.1
run: go install "sigs.k8s.io/controller-runtime/tools/setup-envtest@${SETUP_ENVTEST_VERSION}"

Verified downstream

Applied in jacaudi/wireguard-operator (jacaudi/wireguard-operator#43). With v0.24.1 and assets pinned to 1.30.0, the envtest suite runs for 79s against controller-runtime v0.18.5 — i.e. the tool version really is independent of the library version.

Worth noting the failure mode this sits next to: if the install step were ever made non-fatal, a stage that resolves no assets does not skip, it fails loudly — which is the desired behaviour. The defect here is simply that it fails 100% of the time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions