You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by da...@apache.org on 2026/09/07 07:21:18 UTC

(shenyu) branch fix/#6862 created (now c2b4fe96f0)

This is an automated email from the ASF dual-hosted git repository.

dmsolr pushed a change to branch fix/#6862
in repository https://gitbox.apache.org/repos/asf/shenyu.git


      at c2b4fe96f0 fix(kubernetes-controller): skip generic context path when plugin enabled

This branch includes the following new commits:

     new c2b4fe96f0 fix(kubernetes-controller): skip generic context path when plugin enabled

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(shenyu) 01/01: fix(kubernetes-controller): skip generic context path when plugin enabled

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dmsolr pushed a commit to branch fix/#6862
in repository https://gitbox.apache.org/repos/asf/shenyu.git

commit c2b4fe96f0fdb1423c7375cf6c4ffeef89932fd4
Author: Luke Haochao Zhuang <Lu...@starbucks.cn>
AuthorDate: Mon Sep 7 15:20:56 2026 +0800

    fix(kubernetes-controller): skip generic context path when plugin enabled
---
 .../apache/shenyu/k8s/parser/IngressParser.java    |  2 +-
 .../org/apache/shenyu/k8s/DubboReconcilerTest.java | 32 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java b/shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java
index a9ef809a5b..560e333293 100644
--- a/shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java
+++ b/shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/IngressParser.java
@@ -72,7 +72,7 @@ public class IngressParser implements K8sResourceListParser<V1Ingress> {
         boolean grpcEnabled = getBooleanAnnotation(ingress, IngressConstants.PLUGIN_GRPC_ENABLED);
         boolean sofaEnabled = getBooleanAnnotation(ingress, IngressConstants.PLUGIN_SOFA_ENABLED);
 
-        if (!dubboEnabled || !sofaEnabled) {
+        if (!dubboEnabled && !webSocketEnabled && !brpcEnabled && !grpcEnabled && !sofaEnabled) {
             contextPathParse(ingress, shenyuMemoryConfigList, coreV1Api);
         }
         if (dubboEnabled) {
diff --git a/shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/DubboReconcilerTest.java b/shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/DubboReconcilerTest.java
index a4cac65997..f033bb3477 100644
--- a/shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/DubboReconcilerTest.java
+++ b/shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/DubboReconcilerTest.java
@@ -150,4 +150,36 @@ public final class DubboReconcilerTest {
         verify(shenyuCacheRepository).saveOrUpdateRuleData(any());
         verify(shenyuCacheRepository).saveOrUpdateMetaData(any());
     }
+
+    @Test
+    public void testParseSkipsContextPathWhenDubboEnabled() {
+        Map<String, String> annotations = new HashMap<>();
+        annotations.put("kubernetes.io/ingress.class", "shenyu");
+        annotations.put("shenyu.apache.org/plugin-dubbo-enabled", "true");
+        annotations.put("shenyu.apache.org/zookeeper-register-address", "zookeeper://zookeeperService:2181");
+        annotations.put("shenyu.apache.org/upstreams-protocol", "dubbo://,dubbo://");
+        Map<String, String> labels = new HashMap<>();
+        labels.put("shenyu.apache.org/metadata-labels-1", "dubboFindIdService");
+
+        V1Ingress ingress = new V1IngressBuilder().withNewMetadata()
+                .withName("mockedIngress")
+                .withNamespace("mockedNamespace")
+                .withAnnotations(annotations)
+                .withLabels(labels)
+                .endMetadata()
+                .withNewSpec()
+                .withRules(new V1IngressRuleBuilder()
+                        .withNewHttp()
+                        .withPaths(new V1HTTPIngressPathBuilder().withPath("/**")
+                                .withNewBackend()
+                                .withNewService().withName("testService").withNewPort().withNumber(20888).endPort().endService()
+                                .endBackend().build())
+                        .endHttp()
+                        .build())
+                .endSpec()
+                .build();
+
+        IngressParser ingressParser = new IngressParser(serviceInformer, endpointsInformer);
+        Assertions.assertEquals(1, ingressParser.parse(ingress, mock(io.kubernetes.client.openapi.apis.CoreV1Api.class)).size());
+    }
 }