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

[Feature]: use webhooks to verify mutually exclusive fields #139

Open
whg517 opened this issue Sep 2, 2024 · 0 comments
Open

[Feature]: use webhooks to verify mutually exclusive fields #139

whg517 opened this issue Sep 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@whg517
Copy link
Member

whg517 commented Sep 2, 2024

Duplicates

I have searched the existing issues

Summary 💡

In some field attributes, it is necessary to verify the mutually exclusive condition of the attribute fields. The oneof field configuration cannot be generated using kubebuilder's mark, so it is necessary to implement the logical verification on the server side through webhook.

expect:

spec:
  properties:
    provider:
      oneOf:
      - required:
          - static
      - required:
          - ldap
      - required:
          - oidc
      - required:
          - tls
      properties:
        ldap:
          type: object
        oidc:
          type: object
        static:
          type: object
        tls:
          type: object
      type: object
  type: object

Actual kubebuilder can only be generated:

spec:
  properties:
    provider:
      properties:
        ldap:
          type: object
        oidc:
          type: object
        static:
          type: object
        tls:
          type: object
      type: object
  type: object

Some useful links:

@whg517 whg517 added the enhancement New feature or request label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant