feat[66]: Add advanced CEL validation#210
Merged
AndresNico merged 4 commits intomainfrom Mar 16, 2026
Merged
Conversation
78cf6ed to
b4a9518
Compare
SatabdiG
reviewed
Mar 16, 2026
Collaborator
SatabdiG
left a comment
There was a problem hiding this comment.
Good work. Some comments from my side.
|
|
||
| // (String) The username of the Cloud Foundry user to assign the role to. | ||
| // +kubebuilder:validation:Required | ||
| Username string `json:"username,omitempty" tf:"username,omitempty"` |
Collaborator
There was a problem hiding this comment.
minor: Both username and type have omit empty. If someone enters an empty Type, CEL would fire with Type required, the field itself gives no indication that it's required.
Maybe we can add +kubebuilder:validation:Optional, just to make the intent clear?
Collaborator
Author
There was a problem hiding this comment.
Added that to both username and type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #74, Closes: #75, Closes: #76, Closes: #77, Closes: #78, Closes: #79
Part Of: #66
Advanced CEL validation
Reference Fields Issue
Resources modified:
Domain #79
When forProvider.Domain and forProvider.subDomain is set, the controller populates forProvider.name. It is not possible to enforce that either one or the others are set only that at least one or the others are set.
Space #78
See Reference Fields
ServiceCredentialBinding #77
See Reference Fields
See Reference Fields
OrgRole & SpaceRole #76
See Reference Fields
See Reference Fields
OrgMembers & SpaceMembers #75
See Reference Fields
See Reference Fields
ServiceInstance #74
Basically the same as domain. Controller populates id if offering and plan is set. Can only make sure that at least one or the other is set
Testing
Tested the changes locally to ensure the expected evaluation behavior