code-generator
code-generator copied to clipboard
Bug Report: Missing Package Imports in zz_generated.register.go File
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
- Use
register-gento generate azz_generated.register.gofile. - Attempt to compile the project.
- 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-generatorversion:1.32 -
Go version:
1.23.4
Thank you for your attention to this issue. Please let me know if further details are required.