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

Revise CRD code markers/validations #5105

Closed
1 task
pmalek opened this issue Nov 7, 2023 · 2 comments
Closed
1 task

Revise CRD code markers/validations #5105

pmalek opened this issue Nov 7, 2023 · 2 comments
Assignees
Labels
area/CRD Changes in existing CRDs or introduction of new ones area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. priority/low
Milestone

Comments

@pmalek
Copy link
Member

pmalek commented Nov 7, 2023

Problem statement

#5103 tries to solve #5061 but leaves the CRD validations unreviewed.

For instance:

  • KongConsumer's Username is required (enforced in admission webhook) but that could easily be changed to a required field on the CRD level via:

        // +kubebuilder:validation:Required
        Username string `json:"username"`
    

    This unfortunately can only be done when the // +kubebuilder:validation:Optional is removed from the package as that overrides the field level setting.

Acceptance criteria

  • All Kong provided CRDs are reviewed for moving validation code from admission webhook to CRD level and all possible changes are merged to main
@pmalek pmalek added area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. area/CRD Changes in existing CRDs or introduction of new ones labels Nov 7, 2023
@pmalek pmalek added this to the KIC v3.1.0 milestone Nov 7, 2023
@mflendrich mflendrich modified the milestones: KIC v3.1.x, KIC v3.2.x Jan 15, 2024
@lahabana lahabana modified the milestones: KIC v3.2.x, KIC v3.3.x Jun 5, 2024
@randmonkey
Copy link
Contributor

randmonkey commented Aug 12, 2024

@pmalek Please check if there are nothing in the current webhook that can be moved to CRD annotations. If there is anything to do, please move it to milestone 3.4, otherwise close it.

@pmalek
Copy link
Member Author

pmalek commented Aug 12, 2024

Just did a spot check and I don't see anything obvious that could be moved to CEL/code markers.

Most of what we do in KIC's admission webhook these days is either cross object validation or validating against Gateway schema, neither of which can be done in CEL/code markers.

Closing.

@pmalek pmalek closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CRD Changes in existing CRDs or introduction of new ones area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. priority/low
Projects
None yet
Development

No branches or pull requests

4 participants