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

Min and Max validation for KafkaCluster.spec.Brokers.[].Id #924

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

mihaialexandrescu
Copy link
Contributor

Q A
Bug fix? no
New feature? no
API breaks? no
Deprecations? no
Related tickets partially #913
License Apache 2.0

What's in this PR?

This PR adds kubebuilder markers to implement a minimal validation of the KafkaCluster.spec.Brokers.[].Id field according to #913.

The updates to the CRD are generated with make manifests.

Additional context

I chose the Maximum + ExclusiveMaximum combination of settings because 65535 is a more recognisable number than 65534.

@mihaialexandrescu mihaialexandrescu marked this pull request as ready for review February 2, 2023 15:33
@mihaialexandrescu mihaialexandrescu requested a review from a team as a code owner February 2, 2023 15:33
Copy link
Contributor

@Kuvesz Kuvesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, though we will have to fix the other part of the issue as well.
That will be a little less trivial I guess.

Copy link
Member

@pregnor pregnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I like the special number + max + exclusive approach much.

@mihaialexandrescu mihaialexandrescu merged commit c26d16e into master Feb 2, 2023
@mihaialexandrescu mihaialexandrescu deleted the fix/minmax_validate_brokerid branch February 2, 2023 17:18
bartam1 pushed a commit that referenced this pull request Feb 17, 2023
* add just kubebuilder validation markers; code generation NOT run

* update CRDs via make manifests
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

Successfully merging this pull request may close these issues.

Broker.Id data type is incorrect and some within range numbers would result in reconciler error
3 participants