Skip to content

Commit

Permalink
chore(deps): bump github.com/kong/go-kong from 0.47.0 to 0.48.0 (#5012)…
Browse files Browse the repository at this point in the history
… (#5121)

* chore(deps): bump github.com/kong/go-kong from 0.47.0 to 0.48.0

Bumps [github.com/kong/go-kong](https://github.com/kong/go-kong) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/kong/go-kong/releases)
- [Changelog](https://github.com/Kong/go-kong/blob/main/CHANGELOG.md)
- [Commits](Kong/go-kong@v0.47.0...v0.48.0)

---
updated-dependencies:
- dependency-name: github.com/kong/go-kong
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: adjust route priority calculation code after changing route priority to uint64

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Patryk Małek <[email protected]>
(cherry picked from commit 0422f3b)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
czeslavo and dependabot[bot] authored Nov 8, 2023
1 parent d1b0b0d commit af4f26e
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,8 @@ issues:
- gosec
text: "Potential HTTP request made with variable url"
path: test\.go

- linters:
- revive
text: "var-declaration: should drop = 0 from declaration of var .*; it is the zero value"
path: \.go
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ require (
github.com/bombsimon/logrusr/v4 v4.0.0
github.com/go-logr/logr v1.2.4
github.com/goccy/go-json v0.10.2
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.4.0
github.com/jpillora/backoff v1.0.0
github.com/kong/deck v1.26.1
github.com/kong/go-kong v0.47.0
github.com/kong/go-kong v0.48.0
github.com/kong/kubernetes-telemetry v0.1.1
github.com/kong/kubernetes-testing-framework v0.39.1
github.com/lithammer/dedent v1.1.0
Expand Down Expand Up @@ -60,7 +60,7 @@ require (
sigs.k8s.io/gateway-api v0.8.1
sigs.k8s.io/kustomize/api v0.14.0
sigs.k8s.io/kustomize/kyaml v0.14.3
sigs.k8s.io/yaml v1.3.0
sigs.k8s.io/yaml v1.4.0
)

require (
Expand Down Expand Up @@ -169,7 +169,7 @@ require (
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cast v1.5.1 // indirect
github.com/ssgelm/cookiejarparser v1.0.1 // indirect
github.com/tidwall/gjson v1.16.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.13.0 h1:y1C7Z3e149OJbOPDBxLYR8ITPz8dTKqQwjErKVHJC8k=
github.com/google/go-containerregistry v0.13.0/go.mod h1:J9FQ+eSS4a1aC2GNZxvNpbWhgp0487v+cgiilB4FqDo=
github.com/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE=
Expand All @@ -195,8 +196,8 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM=
github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w=
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
Expand Down Expand Up @@ -248,8 +249,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kong/deck v1.26.1 h1:NwG/Zty5B0TlyDvHB9IlF9c7zRHDVEaYHFRjqxEM2yg=
github.com/kong/deck v1.26.1/go.mod h1:B6f2nPWzTld/aTvtxAC6lWFIcAr4FsG25fgycdzeZQY=
github.com/kong/go-kong v0.47.0 h1:fuZjRnUChITogljM4mY4HGGTKTaZM50970Wwg6EvQgs=
github.com/kong/go-kong v0.47.0/go.mod h1:QaLx1EsT+roe5V6h7aKghwLn0bXg7l/Bg8wzlcCmygc=
github.com/kong/go-kong v0.48.0 h1:vK1OpoxO50qlKdwPfmx9ChvkTKRsoCCB3b3iHo1umLc=
github.com/kong/go-kong v0.48.0/go.mod h1:qH4CEFqT83ywmu1TlMZX09clQH4B8/dX88CtT/jdv/E=
github.com/kong/kubernetes-telemetry v0.1.1 h1:q8iABCuonO16p5q6QVygr7J39G5o5jK5Y3w3ZlE8JC4=
github.com/kong/kubernetes-telemetry v0.1.1/go.mod h1:0yzRZVPwKeOQUFMWbROEJzUE1z8WWngWiujoYtdEEPA=
github.com/kong/kubernetes-testing-framework v0.39.1 h1:30dTVe0Muda3r6NAMQHvdGLuB+nkhZRXnJA8AJjuvO4=
Expand Down Expand Up @@ -409,8 +410,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg=
github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
Expand Down Expand Up @@ -662,5 +663,6 @@ sigs.k8s.io/kustomize/kyaml v0.14.3 h1:WpabVAKZe2YEp/irTSHwD6bfjwZnTtSDewd2BVJGM
sigs.k8s.io/kustomize/kyaml v0.14.3/go.mod h1:npvh9epWysfQ689Rtt/U+dpOJDTBn8kUnF1O6VzvmZA=
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk=
sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
4 changes: 2 additions & 2 deletions internal/dataplane/parser/atc/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

// ApplyExpression sets a Matcher as a Kong route's expression and assigns the route the given priority.
func ApplyExpression(r *kong.Route, m Matcher, priority int) {
func ApplyExpression(r *kong.Route, m Matcher, priority uint64) {
r.Expression = kong.String(m.Expression())
r.Priority = kong.Int(priority)
r.Priority = kong.Uint64(priority)
}
10 changes: 5 additions & 5 deletions internal/dataplane/parser/translate_httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ func TestIngressRulesFromSplitHTTPRouteMatchWithPriority(t *testing.T) {
Expression: kong.String(`http.path == "/v1/foo"`),
PreserveHost: kong.Bool(true),
StripPath: kong.Bool(false),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
Plugins: []kong.Plugin{},
ExpressionRoutes: true,
Expand Down Expand Up @@ -2012,7 +2012,7 @@ func TestIngressRulesFromSplitHTTPRouteMatchWithPriority(t *testing.T) {
Expression: kong.String(`(http.host == "foo.com") && (http.path == "/v1/foo")`),
PreserveHost: kong.Bool(true),
StripPath: kong.Bool(false),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
Plugins: []kong.Plugin{
{
Expand Down Expand Up @@ -2090,7 +2090,7 @@ func TestIngressRulesFromSplitHTTPRouteMatchWithPriority(t *testing.T) {
Expression: kong.String(`(http.host =^ ".foo.com") && (http.path == "/v1/foo")`),
PreserveHost: kong.Bool(true),
StripPath: kong.Bool(false),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
Plugins: []kong.Plugin{},
ExpressionRoutes: true,
Expand Down Expand Up @@ -2143,7 +2143,7 @@ func TestIngressRulesFromSplitHTTPRouteMatchWithPriority(t *testing.T) {
Expression: kong.String(`http.host == "a.foo.com"`),
PreserveHost: kong.Bool(true),
StripPath: kong.Bool(false),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
Plugins: []kong.Plugin{},
ExpressionRoutes: true,
Expand Down Expand Up @@ -2193,7 +2193,7 @@ func TestIngressRulesFromSplitHTTPRouteMatchWithPriority(t *testing.T) {
Expression: kong.String(translators.CatchAllHTTPExpression),
PreserveHost: kong.Bool(true),
StripPath: kong.Bool(false),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
Plugins: []kong.Plugin{},
ExpressionRoutes: true,
Expand Down
5 changes: 5 additions & 0 deletions internal/dataplane/parser/translators/atc_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const (
ResourceKindBitsGRPCRoute = 1
)

type (
// RoutePriorityType is the type of priority field of Kong routes.
RoutePriorityType = uint64
)

const (
// CatchAllHTTPExpression is the expression to match all HTTP/HTTPS requests.
// For rules with no matches and no hostnames in its parent HTTPRoute or GRPCRoute,
Expand Down
20 changes: 10 additions & 10 deletions internal/dataplane/parser/translators/grpcroute_atc.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func CalculateGRCPRouteMatchPriorityTraits(match SplitGRPCRouteMatch) GRPCRouteP
//
// REVIEW: althogh not specified in official docs, do we need to assign a bit for GRPC method match type
// to assign higher priority for method match with `Exact` match?
func (t GRPCRoutePriorityTraits) EncodeToPriority() int {
func (t GRPCRoutePriorityTraits) EncodeToPriority() RoutePriorityType {
const (
// PreciseHostnameShiftBits assigns bit 49 for marking if the hostname is non-wildcard.
PreciseHostnameShiftBits = 49
Expand All @@ -319,15 +319,15 @@ func (t GRPCRoutePriorityTraits) EncodeToPriority() int {
// and start from all 1s, then decrease by one for each GRPCRoute.
)

var priority int
var priority RoutePriorityType
priority += ResourceKindBitsGRPCRoute << FromResourceKindPriorityShiftBits
if t.PreciseHostname {
priority += (1 << PreciseHostnameShiftBits)
}
priority += t.HostnameLength << HostnameLengthShiftBits
priority += t.ServiceLength << ServiceLengthShiftBits
priority += t.MethodLength << MethodLengthShiftBits
priority += t.HeaderCount << HeaderCountShiftBits
priority += RoutePriorityType(t.HostnameLength) << HostnameLengthShiftBits
priority += RoutePriorityType(t.ServiceLength) << ServiceLengthShiftBits
priority += RoutePriorityType(t.MethodLength) << MethodLengthShiftBits
priority += RoutePriorityType(t.HeaderCount) << HeaderCountShiftBits

return priority
}
Expand All @@ -344,7 +344,7 @@ type SplitGRPCRouteMatch struct {

type SplitGRPCRouteMatchToPriority struct {
Match SplitGRPCRouteMatch
Priority int
Priority uint64
}

// AssignRoutePriorityToSplitGRPCRouteMatches assigns priority to ALL split GRPCRoute matches
Expand All @@ -358,7 +358,7 @@ func AssignRoutePriorityToSplitGRPCRouteMatches(
logger logr.Logger,
splitGRPCouteMatches []SplitGRPCRouteMatch,
) []SplitGRPCRouteMatchToPriority {
priorityToSplitGRPCRouteMatches := map[int][]SplitGRPCRouteMatch{}
priorityToSplitGRPCRouteMatches := map[RoutePriorityType][]SplitGRPCRouteMatch{}
for _, match := range splitGRPCouteMatches {
priority := CalculateGRCPRouteMatchPriorityTraits(match).EncodeToPriority()
priorityToSplitGRPCRouteMatches[priority] = append(priorityToSplitGRPCRouteMatches[priority], match)
Expand All @@ -371,7 +371,7 @@ func AssignRoutePriorityToSplitGRPCRouteMatches(
// sort them then starts with 2^14 -1 and decrease by one for each GRPCRoute;
// If only one GRPCRoute occupies the priority, fill the relative order bits with all 1s.
const relativeOrderAssignedBits = 14
const defaultRelativeOrderPriorityBits = (1 << relativeOrderAssignedBits) - 1
const defaultRelativeOrderPriorityBits RoutePriorityType = (1 << relativeOrderAssignedBits) - 1

for priority, matches := range priorityToSplitGRPCRouteMatches {
if len(matches) == 1 {
Expand All @@ -388,7 +388,7 @@ func AssignRoutePriorityToSplitGRPCRouteMatches(
})

for i, match := range matches {
relativeOrderBits := defaultRelativeOrderPriorityBits - i
relativeOrderBits := defaultRelativeOrderPriorityBits - RoutePriorityType(i)
// Although it is very unlikely that there are 2^14 = 16384 GRPCRoutes
// should be given priority by their relative order, here we limit the
// relativeOrderBits to be at least 0.
Expand Down
30 changes: 15 additions & 15 deletions internal/dataplane/parser/translators/grpcroute_atc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match.0.0"),
Expression: kong.String(`(http.path ^= "/service0/") && (http.headers.x_foo == "Bar")`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
},
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match-with-hostname.0.0"),
Expression: kong.String(`(http.path == "/service0/method0") && ((http.host == "foo.com") || (http.host =^ ".foo.com"))`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
},
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.multiple-matches.0.0"),
Expression: kong.String(`(http.path =^ "/method0") && ((http.headers.client == "kong-test") && (http.headers.version == "2"))`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
{
Expand All @@ -149,7 +149,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.multiple-matches.0.1"),
Expression: kong.String(`http.path ~ "^/v[012]/.+"`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
},
Expand Down Expand Up @@ -188,7 +188,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match-with-annotations.0.0"),
Expression: kong.String(`(http.path == "/service0/method0") && (tls.sni == "kong.foo.com")`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
},
Expand All @@ -211,7 +211,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
Route: kong.Route{
Name: kong.String("grpcroute.default.hostname-only.0.0"),
Expression: kong.String(`http.host == "foo.com"`),
Priority: kong.Int(1),
Priority: kong.Uint64(1),
},
},
},
Expand Down Expand Up @@ -605,7 +605,7 @@ func TestGRPCRouteTraitsEncodeToPriority(t *testing.T) {
testCases := []struct {
name string
traits GRPCRoutePriorityTraits
exprectedPriority int
exprectedPriority RoutePriorityType
}{
{
name: "precise hostname",
Expand Down Expand Up @@ -654,7 +654,7 @@ func TestAssignRoutePriorityToSplitGRPCRouteMatches(t *testing.T) {
name string
splitGRPCRouteMatches []SplitGRPCRouteMatch
// GRPCRoute index -> priority
priorities map[splitGRPCRouteMatchIndex]int
priorities map[splitGRPCRouteMatchIndex]RoutePriorityType
}{
{
name: "no dupelicated fixed priority",
Expand Down Expand Up @@ -724,7 +724,7 @@ func TestAssignRoutePriorityToSplitGRPCRouteMatches(t *testing.T) {
},
},
},
priorities: map[splitGRPCRouteMatchIndex]int{
priorities: map[splitGRPCRouteMatchIndex]RoutePriorityType{
{
namespace: "default",
name: "grpcroute-1",
Expand Down Expand Up @@ -822,7 +822,7 @@ func TestAssignRoutePriorityToSplitGRPCRouteMatches(t *testing.T) {
MatchIndex: 0,
},
},
priorities: map[splitGRPCRouteMatchIndex]int{
priorities: map[splitGRPCRouteMatchIndex]RoutePriorityType{
{
namespace: "default",
name: "grpcroute-1",
Expand Down Expand Up @@ -919,7 +919,7 @@ func TestAssignRoutePriorityToSplitGRPCRouteMatches(t *testing.T) {
MatchIndex: 0,
},
},
priorities: map[splitGRPCRouteMatchIndex]int{
priorities: map[splitGRPCRouteMatchIndex]RoutePriorityType{
{
namespace: "default",
name: "grpcroute-1",
Expand Down Expand Up @@ -1029,7 +1029,7 @@ func TestAssignRoutePriorityToSplitGRPCRouteMatches(t *testing.T) {
MatchIndex: 1,
},
},
priorities: map[splitGRPCRouteMatchIndex]int{
priorities: map[splitGRPCRouteMatchIndex]RoutePriorityType{
{
namespace: "default",
name: "grpcroute-1",
Expand Down Expand Up @@ -1131,7 +1131,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
Name: kong.String("grpcroute.default.no-hostname-exact-method._.0.0"),
PreserveHost: kong.Bool(true),
Expression: kong.String(`http.path == "/pets/list"`),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
ExpressionRoutes: true,
},
Expand Down Expand Up @@ -1183,7 +1183,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
Name: kong.String("grpcroute.default.precise-hostname-regex-method.foo.com.0.0"),
Expression: kong.String(`(http.path ~ "^/name/[a-z0-9]+") && (http.host == "foo.com")`),
PreserveHost: kong.Bool(true),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
ExpressionRoutes: true,
},
Expand Down Expand Up @@ -1252,7 +1252,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
Name: kong.String("grpcroute.default.wildcard-hostname-header-match._.foo.com.0.1"),
Expression: kong.String(`(http.path ^= "/name/") && (http.headers.foo == "bar") && (http.host =^ ".foo.com")`),
PreserveHost: kong.Bool(true),
Priority: kong.Int(1024),
Priority: kong.Uint64(1024),
},
ExpressionRoutes: true,
},
Expand Down
Loading

0 comments on commit af4f26e

Please sign in to comment.