-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add unique items validator #48
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
base: main
Are you sure you want to change the base?
feat: add unique items validator #48
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sammyjroberts The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@everettraven learning from KAL, is there anything here that reminds us we need to registry these? Do we want to copy over a similar script as we just added for KAL?
| // incompatible changes to the uniqueItems constraints of CRD properties. | ||
| // The uniqueItems constraint enforces that lists should only contain unique items. | ||
| // Going from non-unique to unique is more restrictive and breaking. | ||
| // Going from unique to non-unique is less restrictive and OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depends on who you are aiming your compatibility at. Going to non-unique may surprise readers. I think we need to enforce in both directions, but have an option for folks to choose whether they are ok moving to the less restrictive option
| var ( | ||
| // ErrUniqueItemsConstraintAdded represents an error state where a uniqueItems constraint was added to a property. | ||
| ErrUniqueItemsConstraintAdded = errors.New("uniqueItems constraint added when there was none previously") | ||
| ) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, missing final new char line here
| } | ||
|
|
||
| internaltesting.RunTestcases(t, testcases...) | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, missing final new line char
#22