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

Allow for unknown fields in the CRD Spec #6739

Open
kelhelawy opened this issue Dec 17, 2024 · 1 comment
Open

Allow for unknown fields in the CRD Spec #6739

kelhelawy opened this issue Dec 17, 2024 · 1 comment

Comments

@kelhelawy
Copy link

Hi,
I know I can use @PreserveUnknownFields in fields inside the specs to allow for unknown fields, but is there a way to do so in the specs itself (the parent), not a field inside?
In the CRD it is possible by doing so:

spec:
  group: "..."
  names:
    kind: "..."
  scope: "Namespaced"
  versions:
  - name: "v1"
    schema:
      openAPIV3Schema:
        properties:
          spec:
            x-kubernetes-preserve-unknown-fields: true
            properties:
               ....

But what would be the equivalent of that from java,
The annotation PreserveUnknownFields is not allowed on type

@baloo42
Copy link
Contributor

baloo42 commented Dec 17, 2024

At the moment I think this is not possible because of the missing target in the annotation. See #6740

Once this is implemented, this should be possible in the same way like described for @Required in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants