I have a module that queries data from a Kubernetes cluster. The pods have dots in their names, like “ldap-ndb-df-p.1”. I created a route of type Segment where there is a parameter pod. The router doesn’t match when pod name has a dot. Below it is the route definition. I have added a regex in constraints that matches a text with dot, but it doesn’t work.
'pod-route' => [ 'type' => Segment::class, 'options' => [ 'route' => '/cluster[/:action[/:namespace[/:pod]]]', 'constraints' => [ 'pod' => '[a-zA-Z][a-zA-Z0-9_-]+[\.]+[a-zA-Z0-9_-]+' ], 'defaults' => [ 'controller' => Controller\IndexController::class, 'action' => 'index', ], ], ],
This route works only for parameters action and namespace.
I also have tried to use a route of type Regex, using the same expression in contraints above but it also doesn’t match.
I didn’t find in documentation about routing a guideline about exception treatment for routes. I need to know how I can express properly a route parameter with a dot, or how I can treat the exception, capturing the route unmatched and checking if it has a parameter pod with dot.