Skip to content

Java Model Generation Failed due to error message "The CustomResourceDefinition "xxx" is invalid: metadata.annotations: Too long: must have at most 262144 bytes" #2619

@hippoz

Description

@hippoz

Describe the bug
Java Model Generation Failed due to the following error:

The CustomResourceDefinition "fleets.agones.dev" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Client Version
e.g. 1.25.1

Kubernetes Version
e.g. 1.25.1

Java Version
e.g. Java 11

To Reproduce
This bug is about crd-model-gen

Version: 1.06, 1.05 and 1.04

Steps to reproduce the behavior:

  • download the long CRD definitions (more than 262144 characters), eg: the attached CRD from agones
    fleets.agones.dev.yaml.zip
  • try to generate the Java models following the approach CRD Generation
  • You will see this error

Expected behavior
The models can be generated successfully for long CRD definitions

Workaround
We can workaround this issue by remove all the descriptions from the CRD to make it shorter, but we lost all the java docs after the generation.

KubeConfig
If applicable, add a KubeConfig file with secrets redacted.

Server (please complete the following information):

  • OS: Linux
  • Environment [e.g. container]
  • Cloud [e.g. Azure]

Additional context
Add any other context about the problem here.

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