Skip to content

Align controller-gen version with go.mod and improve Makefile tool installation logic #517

@nekkunti

Description

@nekkunti

Description

What problem are you trying to solve?
There is a version mismatch between the controller-gen binary used locally during CRD generation and the sigs.k8s.io/controller-tools version declared in go.mod. This can result in CRD annotation drift (e.g., controller-gen.kubebuilder.io/version) and non-reproducible builds.

Additionally, the Makefile previously relied on a hardcoded path for controller-gen, which makes the build dependent on a developer’s local environment and may fail in clean or CI environments.

The goal is to:

  • Align controller-tools version in go.mod with the installed controller-gen

  • Ensure deterministic CRD generation

  • Remove user-specific paths from the Makefile

  • Automatically install the correct controller-gen version when missing

  • Make make build work reliably from a clean environment

How important is this feature to you?
This is moderately important as it improves build reproducibility and developer experience. While it does not affect runtime functionality, it prevents unnecessary CRD diffs, CI inconsistencies, and environment-specific build failures.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions