Skip to content

Commit

Permalink
Update "sample" tenant on standalone to stop using old property/clust…
Browse files Browse the repository at this point in the history
…er/namespace naming convention.
  • Loading branch information
cdbartholomew authored and zzzming committed Dec 24, 2020
1 parent 4bb9056 commit dbe1fee
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ private void createDefaultNameSpace(String cluster) {

private void createSampleNameSpace(ClusterData clusterData, String cluster) {
// Create a sample namespace
final String property = "sample";
final String tenant = "sample";
final String globalCluster = "global";
final String namespace = property + "/" + cluster + "/ns1";
final String namespace = tenant + "/ns1";
try {
if (!admin.clusters().getClusters().contains(cluster)) {
admin.clusters().createCluster(cluster, clusterData);
Expand All @@ -405,12 +405,12 @@ private void createSampleNameSpace(ClusterData clusterData, String cluster) {
admin.clusters().createCluster(globalCluster, new ClusterData(null, null));
}

if (!admin.tenants().getTenants().contains(property)) {
admin.tenants().createTenant(property,
if (!admin.tenants().getTenants().contains(tenant)) {
admin.tenants().createTenant(tenant,
new TenantInfo(Sets.newHashSet(config.getSuperUserRoles()), Sets.newHashSet(cluster)));
}

if (!admin.namespaces().getNamespaces(property).contains(namespace)) {
if (!admin.namespaces().getNamespaces(tenant).contains(namespace)) {
admin.namespaces().createNamespace(namespace);
}
} catch (PulsarAdminException e) {
Expand Down

0 comments on commit dbe1fee

Please sign in to comment.