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

CRD generator missing type GenericKubernetesResource in 6.13.4 #6725

Open
csviri opened this issue Dec 16, 2024 · 0 comments
Open

CRD generator missing type GenericKubernetesResource in 6.13.4 #6725

csviri opened this issue Dec 16, 2024 · 0 comments
Labels
bug component/crd-generator Related to the CRD generator

Comments

@csviri
Copy link
Contributor

csviri commented Dec 16, 2024

Describe the bug

When updated fabric8 version for to 6.13.4, the CRD generator generated an invalid CRD for:

  @PreserveUnknownFields
  private GenericKubernetesResource resource;

the result:

resource:
     x-kubernetes-embedded-resource: true
     x-kubernetes-preserve-unknown-fields: true

when I try to apply such resource k8s gives an error message:

spec.validation.openAPIV3Schema.properties[spec].properties[childResources].items.properties[resource].type: Required value: must be object if x-kubernetes-embedded-resource is true

Fabric8 Kubernetes Client version

6.13.4

Steps to reproduce

Open this branch in Kubernetes Glue Operator:

  1. https://github.com/java-operator-sdk/kubernetes-glue-operator/tree/quarkus-update
  2. compile with mvn clean install -DskipTests
  3. apply the generated crd from: kubernetes-glue-operator/target/kubernetes/glues.io.csviri.operator.glue-v1.yml

Expected behavior

What seems to be enough is to have type: object to be added to generated snipper:

resource:
     type: object
     x-kubernetes-embedded-resource: true
     x-kubernetes-preserve-unknown-fields: true

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

@manusa manusa added component/crd-generator Related to the CRD generator bug labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component/crd-generator Related to the CRD generator
Projects
None yet
Development

No branches or pull requests

2 participants