Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make generate modifies Kubernetes version permanently #4611

Closed
vitorfloriano opened this issue Mar 15, 2025 · 2 comments · Fixed by #4612
Closed

make generate modifies Kubernetes version permanently #4611

vitorfloriano opened this issue Mar 15, 2025 · 2 comments · Fixed by #4612
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@vitorfloriano
Copy link
Contributor

What broke? What's expected?

The make generate command currently changes the value of kubernetesVendorVersion in cmd/version.go permanently, possibly as a side effect of kubebuilder issue #4588.

I believe that, IF the version is only needed for generating documentation, persisting this change introduces an unnecessary diff in commits, as shown in this PR review.

The desired behavior is to reset the value to unknown after the process completes to avoid the diff and potential side effects.

Taking a look into the Makefile might be a good starting point to find out what may be causing this issue.

Reproducing this issue

  1. Verify that the kubernetesVendorVersion variable in the cmd/version.go file is initially set to unknown.
  2. Run make generate.
  3. After the process completes, inspect the diff at line 30 in the cmd/version.go file and observe that the change in kubernetesVendorVersion value has persisted.

KubeBuilder (CLI) Version

Version: main.version{KubeBuilderVersion:"4.5.1", KubernetesVendor:"1.32.1", GitCommit:"0ace7a8753c52b35014e43edc2a0b0454b78e769", BuildDate:"2025-02-21T20:16:18Z", GoOs:"linux", GoArch:"amd64"}

PROJECT version

3

Plugin versions

- go.kubebuilder.io/v4

Other versions

No response

Extra Labels

No response

@vitorfloriano vitorfloriano added the kind/bug Categorizes issue or PR as related to a bug. label Mar 15, 2025
@vitorfloriano
Copy link
Contributor Author

/assign

@camilamacedo86
Copy link
Member

camilamacedo86 commented Mar 17, 2025

I just reviewed this. If we can ensure that:

Then, we are good to go.

If you find a solution that meets all these requirements without needing to modify cmd/version.go, that would be even better.

Let me know your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants