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:
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
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()createsContextPathParserfor Prefix paths using the ingress object.ContextPathParser.createContextMappingRuleHandle()then reads:The gRPC and Sofa Kubernetes examples place
shenyu.apache.org/plugin-context-path-pathon the Service, next to the RPC metadata annotations, not on the Ingress. With that shape, context-path parsing can generate a rule withcontextPath == nulland a path condition likenull/**.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.javashenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/ContextPathParser.javashenyu-examples/shenyu-examples-grpc/k8s/ingress.ymlshenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/k8s/ingress.yml