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

validation for spec.cluster.size #60

Merged
merged 2 commits into from
Jun 2, 2023

Conversation

friedrichwilken
Copy link
Contributor

@friedrichwilken friedrichwilken commented Jun 2, 2023

Description

Changes proposed in this pull request:

add validation for cluster.size

Related issue(s)
#9

@friedrichwilken friedrichwilken requested a review from a team as a code owner June 2, 2023 08:54
@kyma-bot kyma-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 2, 2023
@kyma-bot kyma-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 2, 2023
@friedrichwilken friedrichwilken linked an issue Jun 2, 2023 that may be closed by this pull request
9 tasks
@friedrichwilken friedrichwilken self-assigned this Jun 2, 2023
@@ -98,7 +98,9 @@ type NATSSpec struct {
// Cluster defines configurations that are specific to NATS clusters.
type Cluster struct {
// Size of a NATS cluster, i.e. number of NATS nodes.
// +kubebuilder:validation:XValidation:rule="( self % 2 ) != 0", message="size only accepts odd numbers"
// +optional
// +kubebuilder:validation:Minimum:=1
Copy link
Member

Choose a reason for hiding this comment

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

Can't we have 0 replicas?

@kyma-bot kyma-bot added the lgtm Looks good to me! label Jun 2, 2023
@kyma-bot kyma-bot merged commit 456d6f5 into kyma-project:main Jun 2, 2023
1 check passed
@friedrichwilken friedrichwilken deleted the add-cel-validation branch June 2, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Looks good to me! size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial CRD handling
3 participants