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

Bug Report: Missing Package Imports in zz_generated.register.go File #182

Open
hugtale opened this issue Dec 28, 2024 · 0 comments
Open

Comments

@hugtale
Copy link

hugtale commented Dec 28, 2024

Description

When using register-gen from the code-generator package to automatically generate the zz_generated.register.go file, the generated file is missing the import statements for the following packages:

  • k8s.io/apimachinery/pkg/runtime
  • k8s.io/apimachinery/pkg/runtime/schema

This issue causes compilation errors because these packages are required for the generated GroupVersion and SchemeBuilder code to function correctly.

Steps to Reproduce

  1. Use register-gen to generate a zz_generated.register.go file.
  2. Attempt to compile the project.
  3. Observe that the generated file is missing the necessary import statements.

Expected Behavior

The generated zz_generated.register.go file should include the following imports by default:

import (
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
)

This ensures that the generated code compiles without requiring manual modification.

Environment

  • code-generator version: 1.32
  • Go version: 1.23.4

Thank you for your attention to this issue. Please let me know if further details are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant