You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2024/01/10 12:42:54 UTC

Re: [PR] [fix][client] Fix tenant's `allowedClusters` is not updated when removing cluster [pulsar]

poorbarcode commented on code in PR #21740:
URL: https://github.com/apache/pulsar/pull/21740#discussion_r1447336153


##########
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdClusters.java:
##########
@@ -130,9 +132,15 @@ void run() throws PulsarAdminException {
                         getAdmin().namespaces().deleteNamespace(namespace, true);
                     }
                     getAdmin().tenants().deleteTenant(tenant);
+                } else {
+                    Set<String> clusters = getAdmin().tenants().getTenantInfo(tenant).getAllowedClusters();
+                    clusters.remove(cluster);
+                    getAdmin().tenants().updateTenant(tenant, TenantInfo.builder()

Review Comment:
   If the `clusters` only have one element (`@param cluster`), should we delete this tenant?
   
   /cc @codelipenghui @Technoboy- 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org