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 for GenericKubernetesResource #6725

Closed
csviri opened this issue Dec 16, 2024 · 1 comment · Fixed by #6809
Closed

CRD generator missing type for GenericKubernetesResource #6725

csviri opened this issue Dec 16, 2024 · 1 comment · Fixed by #6809
Assignees
Labels
bug component/crd-generator Related to the CRD generator
Milestone

Comments

@csviri
Copy link
Contributor

csviri commented Dec 16, 2024

Describe the bug

When updated fabric8 version for to 6.13.4 but also for 7.0.0+ versions, 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
@csviri csviri changed the title CRD generator missing type GenericKubernetesResource in 6.13.4 CRD generator missing type GenericKubernetesResource Jan 19, 2025
@csviri
Copy link
Contributor Author

csviri commented Jan 19, 2025

Checked, that it is also present in 7.0.1 version.

@csviri csviri changed the title CRD generator missing type GenericKubernetesResource CRD generator missing type for GenericKubernetesResource Jan 19, 2025
@manusa manusa added this to the 7.1.0 milestone Jan 20, 2025 — with automated-tasks
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

Successfully merging a pull request may close this issue.

2 participants