Skip to content

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

Open
@hugtale

Description

@hugtale

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions