1
0
Fork 0

Support RegularExpression for path matching

This commit is contained in:
Dimitris Mavrommatis 2024-05-23 20:08:03 +02:00 committed by GitHub
parent 0e215f9b61
commit 6e61fe0de1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 1 deletions

View file

@ -1894,6 +1894,8 @@ func extractRule(routeRule gatev1.HTTPRouteRule, hostRule string) (string, error
matchRules = append(matchRules, fmt.Sprintf("Path(`%s`)", *match.Path.Value))
case gatev1.PathMatchPathPrefix:
matchRules = append(matchRules, buildPathMatchPathPrefixRule(*match.Path.Value))
case gatev1.PathMatchRegularExpression:
matchRules = append(matchRules, fmt.Sprintf("PathRegexp(`%s`)", *match.Path.Value))
default:
return "", fmt.Errorf("unsupported path match type %s", *match.Path.Type)
}