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
dongjoon-hyun pushed a commit to apache/spark that referenced this issue Feb 13, 2025
### What changes were proposed in this pull request?

This PR aims to upgrade `kubernetes-client` from 7.0.1 to 7.1.0.

### Why are the changes needed?

Keep the dependencies to the latest, and there are some bug fixes in version 7.1.0:
- Fix fabric8io/kubernetes-client#6725: (crd-generator) CRD generator missing type for GenericKubernetesResource
- Fix fabric8io/kubernetes-client#6747: Preventing websocket error logs when the client is closed
- Fix fabric8io/kubernetes-client#6781: Allowing ipv6 entries to work in NO_PROXY
- Fix fabric8io/kubernetes-client#6792: VertxHttpClient uses exclusive Vert.x instance by default

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #49925 from wayneguow/kubernetes-client.

Authored-by: Wei Guo <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit to apache/spark that referenced this issue Feb 14, 2025
### What changes were proposed in this pull request?

This PR aims to upgrade `kubernetes-client` from 7.0.1 to 7.1.0.

### Why are the changes needed?

Keep the dependencies to the latest, and there are some bug fixes in version 7.1.0:
- Fix fabric8io/kubernetes-client#6725: (crd-generator) CRD generator missing type for GenericKubernetesResource
- Fix fabric8io/kubernetes-client#6747: Preventing websocket error logs when the client is closed
- Fix fabric8io/kubernetes-client#6781: Allowing ipv6 entries to work in NO_PROXY
- Fix fabric8io/kubernetes-client#6792: VertxHttpClient uses exclusive Vert.x instance by default

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #49925 from wayneguow/kubernetes-client.

Authored-by: Wei Guo <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit ae2d2e8)
Signed-off-by: Dongjoon Hyun <[email protected]>
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
2 participants