mchtech opened a new issue, #1785:
URL: https://github.com/apache/apisix-ingress-controller/issues/1785

   ### Current Behavior
   
   regex path ingress rules are ordered by create time
   
   ### Expected Behavior
   
   regex path ingress rules are ordered by path length (or alphabetical order?) 
:[ingress-nginx:   first orders the paths by descending 
length](https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/#path-priority)
   
   
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1. config-A:
   ```yaml
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     annotations:
       k8s.apisix.apache.org/use-regex: "true"
     name: ingress-a
     namespace: default
   spec:
     ingressClassName: apisix
     rules:
     - http:
         paths:
         - backend:
             service:
               name: svc-a
               port:
                 name: http
           path: /api/.*   # <---- override ingress-b, but ingress-b is more 
'accurate'
           pathType: ImplementationSpecific
   ```
   2. config-B:
   ```yaml
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     annotations:
       k8s.apisix.apache.org/use-regex: "true"
     name: ingress-b
     namespace: default
   spec:
     ingressClassName: apisix
     rules:
     - http:
         paths:
         - backend:
             service:
               name: svc-b
               port:
                 name: http
           path: /api/bbb/.*
           pathType: ImplementationSpecific
   ```
   3. if first create `ingress-b` (then create `ingress-a`), apisix works as 
expect
   4. if first create `ingress-a` (then create `ingress-b`), `/api/bbb/ccc` 
will still route to `svc-a` (should be `svc-b`)
   
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.2.0
   - Operating system (run `uname -a`): oracle linux 8.6 kernel 5.6.11
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx 
version: openresty/1.21.4.1
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): 3.5.4
   - APISIX Dashboard version, if relevant: 0.8.0
   - Plugin runner version, for issues related to plugin runners: -
   - LuaRocks version, for installation issues (run `luarocks --version`): -
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to