Fix CEL validations for parentRefs and use 'in' operator in some CEL expressions #2320
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.
What type of PR is this?
/kind feature
/kind bug
/kind cleanup
/kind test
What this PR does / why we need it:
Fix CEL validations for parentRefs and use 'in' operator in some CEL expressions
Which issue(s) this PR fixes:
Addresses comments:
Does this PR introduce a user-facing change?:
Explanation for future reference:
The validations in this PR are meant to cover the webhook validations:
gateway-api/apis/v1beta1/validation/common.go
Line 28 in 73f20f4
The validation is split apart into Standard and Experimental (as
Port
field is currently only available inExperimental
). Each of them have two validations:1. sectionName must be specified when parentRefs includes 2 or more references to the same parent
CEL Playground:
The aim of this validation is to ensure that if two references are to the same parent, then:
VALID:
INVALID:
2. sectionName must be unique when parentRefs includes 2 or more references to the same parent
CEL Playground:
This only tries to guarantee that the combination of all fields within
parentRefs
is unique.Something like below is VALID here, but would be considered INVALID for the previous validation