Skip to content

Commit

Permalink
[improve][broker] Support setting forceDeleteTenantAllowed dynamically (
Browse files Browse the repository at this point in the history
#18192)

(cherry picked from commit 1c78e0a)
  • Loading branch information
Technoboy- authored and liangyepianzhou committed Dec 13, 2022
1 parent e3eb026 commit 2909c5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ public class ServiceConfiguration implements PulsarConfiguration {

@FieldContext(
category = CATEGORY_POLICIES,
dynamic = true,
doc = "Allow forced deletion of tenants. Default is false."
)
private boolean forceDeleteTenantAllowed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,4 +1360,16 @@ public void testDynamicConfigurationsForceDeleteNamespaceAllowed() throws Except
assertTrue(conf.isForceDeleteNamespaceAllowed());
});
}

@Test
public void testDynamicConfigurationsForceDeleteTenantAllowed() throws Exception {
cleanup();
conf.setForceDeleteTenantAllowed(false);
setup();
admin.brokers()
.updateDynamicConfiguration("forceDeleteTenantAllowed", "true");
Awaitility.await().untilAsserted(()->{
assertTrue(conf.isForceDeleteTenantAllowed());
});
}
}

0 comments on commit 2909c5a

Please sign in to comment.