Copilot commented on code in PR #6308:
URL: https://github.com/apache/shenyu/pull/6308#discussion_r3006248214
##########
shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java:
##########
@@ -71,9 +71,8 @@ public List<ShenyuMemoryConfig> parse(final V1Ingress
ingress, final CoreV1Api c
boolean webSocketEnabled = getBooleanAnnotation(ingress,
IngressConstants.PLUGIN_WEB_SOCKET_ENABLED);
boolean brpcEnabled = getBooleanAnnotation(ingress,
IngressConstants.PLUGIN_BRPC_ENABLED);
boolean grpcEnabled = getBooleanAnnotation(ingress,
IngressConstants.PLUGIN_GRPC_ENABLED);
- boolean sofaEnabled = getBooleanAnnotation(ingress,
IngressConstants.PLUGIN_SOFA_ENABLED);
- if (!dubboEnabled || !motanEnabled || !sofaEnabled) {
+ if (!dubboEnabled || !motanEnabled) {
contextPathParse(ingress, shenyuMemoryConfigList, coreV1Api);
}
Review Comment:
The condition guarding `contextPathParse` (`if (!dubboEnabled ||
!motanEnabled)`) will evaluate to true for almost every ingress (it is false
only when both dubbo *and* motan are enabled). As a result, the ContextPath
plugin config will be generated even for ingresses that only enable a specific
plugin (e.g., dubbo-only, motan-only, grpc-only), and it also ignores
`webSocketEnabled/brpcEnabled/grpcEnabled` entirely. Consider tightening this
to run only when the ContextPath annotations are actually present, or when none
of the RPC plugin flags are enabled (i.e., the Divide/default path), or
otherwise aligning the boolean logic with the plugin-selection chain below.
--
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]