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. (#10486)

Co-authored-by: Chris Bartholomew <c_bartholomew@yahoo.com>
  • Loading branch information
eolivelli and cdbartholomew authored May 10, 2021
1 parent d39e5e4 commit 4d2d66d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ private void createNameSpace(String cluster, String publicTenant, String default

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 @@ -385,12 +385,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 4d2d66d

Please sign in to comment.