Skip to content

Incompatibility Issue with controller-runtime Version Pinning and envtest Setup - It is requiring go 1.22 when the latest release still using go 1.21 as old project versions #2744

Closed
@camilamacedo86

Description

@camilamacedo86

Problem Description

We've encountered an issue where our environment cannot pin a specific version of controller-runtime, leading to compatibility issues with earlier versions of kubebuilder when setting up envtest. This incompatibility prevents our projects from maintaining a consistent development environment, particularly affecting our CI/CD pipelines.

Error Output

While attempting to set up envtest (go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest), we're met with the following error message due to the version incompatibility besides the LATEST v0.17.2 does not support go 1.22 and old projects not be using it yet as well.

go: downloading sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240327193027-21368602d84b
go: downloading sigs.k8s.io/controller-runtime v0.17.2
go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest: sigs.k8s.io/controller-runtime/tools/[email protected] requires go >= 1.22.0 (running go 1.21.8; GOTOOLCHAIN=local)

This error highlights the requirement for Go version >= 1.22.0, while we are currently using Go 1.21.8.

Ideal Solution (controller-runtime provide a envtest setup solution that allows us pin the tag releases)

Ideally, we need a way to setup envtest that allows version pinning per tag release. This would enable our community to manage dependencies more effectively and ensure compatibility across different versions of kubebuilder and controller-runtime. Note that in many scenarios we might need to do this setup in shell scripts.

Alternative Solution (how we could fix it and which seems the best available approach so far)

Use the release branch, example : go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-17

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions