diff --git a/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/kubernetes/KubernetesModelConverter.java b/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/kubernetes/KubernetesModelConverter.java index f24fa1a2..2a8ac14a 100644 --- a/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/kubernetes/KubernetesModelConverter.java +++ b/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/kubernetes/KubernetesModelConverter.java @@ -873,6 +873,10 @@ private static int compareMatchRules(MatchRule r1, MatchRule r2) { private static void setDefaultValues(V1alpha1WasmPluginSpec spec) { spec.setFailStrategy(FailStrategy.FAIL_OPEN.getName()); + + if (spec.getDefaultConfigDisable() == null){ + spec.setDefaultConfigDisable(true); + } } private static int compareStringLists(List l1, List l2) { diff --git a/backend/sdk/src/test/java/com/alibaba/higress/sdk/service/WasmPluginInstanceServiceTest.java b/backend/sdk/src/test/java/com/alibaba/higress/sdk/service/WasmPluginInstanceServiceTest.java index 35b7291b..0000d104 100644 --- a/backend/sdk/src/test/java/com/alibaba/higress/sdk/service/WasmPluginInstanceServiceTest.java +++ b/backend/sdk/src/test/java/com/alibaba/higress/sdk/service/WasmPluginInstanceServiceTest.java @@ -324,7 +324,7 @@ public void addOrUpdateTestFromUserAddInternalConfig() throws Exception { V1alpha1WasmPlugin cr = crCaptor.getValue(); Assertions.assertNotNull(cr); Assertions.assertEquals(TEST_BUILT_IN_PLUGIN_INTERNAL_CR_NAME, cr.getMetadata().getName()); - Assertions.assertNull(cr.getSpec().getDefaultConfigDisable()); + Assertions.assertTrue(cr.getSpec().getDefaultConfigDisable()); Assertions.assertNull(cr.getSpec().getDefaultConfig()); Assertions.assertEquals(1, cr.getSpec().getMatchRules().size()); MatchRule rule = cr.getSpec().getMatchRules().get(0);