Skip to content

Add CEL validation tests for ObservabilityPolicy CRD #3735

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

Merged
merged 11 commits into from
Aug 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/cel/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
// ClientSettingsPolicy validation errors.
const (
expectedTargetRefKindError = `TargetRef Kind must be one of: Gateway, HTTPRoute, or GRPCRoute`
expectedTargetRefGroupError = `TargetRef Group must be gateway.networking.k8s.io.`
expectedTargetRefGroupError = `TargetRef Group must be gateway.networking.k8s.io`
expectedHeaderWithoutServerError = `header can only be specified if server is specified`
)

Expand All @@ -47,6 +47,13 @@ const (
expectedMinReplicasLessThanOrEqualError = `minReplicas must be less than or equal to maxReplicas`
)

// ObservabilityPolicy validation errors.
const (
expectedTargetRefMustBeHTTPRouteOrGrpcRouteError = `TargetRef Kind must be: HTTPRoute or GRPCRoute`
expectedTargetRefKindAndNameComboMustBeUnique = `TargetRef Kind and Name combination must be unique`
expectedStrategyMustBeOfTypeRatio = `ratio can only be specified if strategy is of type ratio`
)

// UpstreamSettingsPolicy validation errors.
const (
expectedTargetRefKindServiceError = `TargetRefs Kind must be: Service`
Expand Down
Loading
Loading