Aias00 opened a new issue, #6492:
URL: https://github.com/apache/shenyu/issues/6492

   ### Current Behavior
   
   For Prefix-type gRPC/Sofa ingresses, context-path parsing reads context-path 
annotations from the ingress metadata, while the repository examples put those 
annotations on the Service metadata.
   
   `IngressParser.contextPathParse()` creates `ContextPathParser` for Prefix 
paths using the ingress object. 
`ContextPathParser.createContextMappingRuleHandle()` then reads:
   
   ```java
   
ruleHandle.setContextPath(annotations.get(IngressConstants.PLUGIN_CONTEXT_PATH_PATH));
   ```
   
   The gRPC and Sofa Kubernetes examples place 
`shenyu.apache.org/plugin-context-path-path` on the Service, next to the RPC 
metadata annotations, not on the Ingress. With that shape, context-path parsing 
can generate a rule with `contextPath == null` and a path condition like 
`null/**`.
   
   ### Expected Behavior
   
   Context-path parsing should read the annotation from the same resource where 
the RPC parser expects the service metadata, or the examples and parser 
contract should be aligned so valid examples do not generate invalid 
context-path rules.
   
   ### Impact
   
   The documented/example gRPC and Sofa ingress setup can produce broken 
context-path rules for Prefix paths.
   
   ### Code Location
   
   - 
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java`
   - 
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/ContextPathParser.java`
   - `shenyu-examples/shenyu-examples-grpc/k8s/ingress.yml`
   - 
`shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/k8s/ingress.yml`
   


-- 
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