This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new c0757254a0e [improve][admin] Return BAD_REQUEST on cluster data is
null for createCluster (#20346)
c0757254a0e is described below
commit c0757254a0ea2625ffc6d97687a715201e20ef2f
Author: tison <[email protected]>
AuthorDate: Thu May 18 23:19:10 2023 +0800
[improve][admin] Return BAD_REQUEST on cluster data is null for
createCluster (#20346)
---
.../main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
index e61a7f20d1d..5d4ed54c334 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
@@ -162,6 +162,9 @@ public class ClustersBase extends AdminResource {
.thenCompose(__ -> validatePoliciesReadOnlyAccessAsync())
.thenCompose(__ -> {
NamedEntity.checkName(cluster);
+ if (clusterData == null) {
+ throw new RestException(Status.BAD_REQUEST, "cluster
data is required");
+ }
try {
clusterData.checkPropertiesIfPresent();
} catch (IllegalArgumentException ex) {