Skip to content

Commit af41450

Browse files
authored
Add cel tests for upstreamsettingspolicy (#3742)
Problem: There were no CEL tests for UpstreamSettingsPolicy Solution: I added it
1 parent e0607ee commit af41450

File tree

2 files changed

+384
-0
lines changed

2 files changed

+384
-0
lines changed

tests/cel/common.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ const (
2222
grpcRouteKind = "GRPCRoute"
2323
tcpRouteKind = "TCPRoute"
2424
invalidKind = "InvalidKind"
25+
serviceKind = "Service"
2526
)
2627

2728
const (
2829
gatewayGroup = "gateway.networking.k8s.io"
2930
invalidGroup = "invalid.networking.k8s.io"
3031
discoveryGroup = "discovery.k8s.io/v1"
32+
coreGroup = "core"
33+
emptyGroup = ""
3134
)
3235

3336
// ClientSettingsPolicy validation errors.
@@ -44,6 +47,13 @@ const (
4447
expectedMinReplicasLessThanOrEqualError = `minReplicas must be less than or equal to maxReplicas`
4548
)
4649

50+
// UpstreamSettingsPolicy validation errors.
51+
const (
52+
expectedTargetRefKindServiceError = `TargetRefs Kind must be: Service`
53+
expectedTargetRefGroupCoreError = `TargetRefs Group must be core`
54+
expectedTargetRefNameUniqueError = `TargetRef Name must be unique`
55+
)
56+
4757
const (
4858
defaultNamespace = "default"
4959
)

0 commit comments

Comments
 (0)