Skip to content

Commit

Permalink
fix: Set the defaultConfigDisable of WasmPlugin CR to false by default (
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Nov 18, 2024
1 parent 8f793b4 commit 9693ac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> l1, List<String> l2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9693ac2

Please sign in to comment.