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

client-gen generates empty files when using Go 1.23 #176

Open
JRBANCEL opened this issue Aug 13, 2024 · 6 comments
Open

client-gen generates empty files when using Go 1.23 #176

JRBANCEL opened this issue Aug 13, 2024 · 6 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@JRBANCEL
Copy link

We use client-gen like this:

client-gen \
        --input-base "github.com/<WHATEVER>/pkg/apis" \
        --input "dedicated/v1alpha1" \
        --output-pkg github.com/<WHATEVER>/pkg/clientset \
        --go-header-file hack/header.txt \
        --clientset-name versioned \
        --output-dir ./pkg/clientset

Works fine in 1.22.0 (and v0.30.1).

Now, when I bump go.mod to use 1.23.0, client-gen generates files with just the package statement:

// Code generated by client-gen. DO NOT EDIT.

package v1alpha1

Output with -v 10 doesn't show anything interesting.
I tried to update client-gen to v0.31.0, same result.

@Airblader
Copy link

Several people in my team have the same issue with tooling like deepcopy-gen. Oddly, though, for me it seems to work.

@luca-filipponi
Copy link

@JRBANCEL try to clean the go mod cache go clean -modcache, this worked for us

@zaininHub
Copy link

go mod cache clean doesnt help, has any solution else?

@dpeckett
Copy link

dpeckett commented Dec 3, 2024

What's happening here is that code-generator needs to built with the same major.minor version of Go as your project (due to the way it hooks into the go toolchain). If you use go install or go run it will automatically downgrade to the toolchain version in the code-generator go.mod.

To fix this, just export GOTOOLCHAIN=go1.23.3 or whatever version is appropriate before running go install / go run.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 3, 2025
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

7 participants