Skip to content

[BUG] IngressParser contextPathParse condition uses || instead of && — runs for dubbo/sofa ingresses #6862

Description

@Aias00

Description

Line 75: if (!dubboEnabled || !sofaEnabled) calls contextPathParse whenever at least one of dubbo/sofa is disabled. Since dubbo and sofa are mutually exclusive (the if/else chain on lines 78–93 picks at most one), this condition is true for every ingress — including dubbo-only and sofa-only ingresses. The intent is !dubboEnabled && !sofaEnabled (run contextPathParse only when neither RPC plugin is enabled, i.e. for HTTP-based plugins). With ||, contextPathParse runs for dubbo/sofa ingresses, adding a ContextPathParser ShenyuMemoryConfig alongside the DubboIngressParser/SofaParser one, creating duplicate context-path selectors.

Location

  • shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java:75

Impact

Dubbo/Sofa ingresses get spurious context-path-plugin selectors with null/"null/**" rule conditions (see M-11), polluting the selector cache and potentially causing routing ambiguity.

Suggested fix

Change || to &&.

Related existing

None — GOV-T6 (#6679) covers parser zero-tests; this is a logic operator defect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions