From b28cd969df80d584894b517106cb67c99283626b Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Tue, 13 Dec 2022 19:05:11 +0800 Subject: [PATCH] [branch-2.11][fix][cpp] Fix the standalone set up ### Motivation https://github.com/apache/pulsar/pull/15186 changed the behavior of how to create the default namespace. However, it brings a regression that even if the built-in admin didn't have the authentication configured while the standalone enabled the authentication, the namespace could still be created successfully. This PR also changed the deploy script to remove the creation of "public/default" namespace. Instead, it grants the permission to this namespace directly. After https://github.com/apache/pulsar/pull/17864 and https://github.com/apache/pulsar/pull/18837, the namespace will be created by the built-in admin again. But the deploy script would fail. ### Modifications Create the default namespace via `pulsar-admin` in the deploy script. --- pulsar-client-cpp/pulsar-test-service-start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pulsar-client-cpp/pulsar-test-service-start.sh b/pulsar-client-cpp/pulsar-test-service-start.sh index 63915cfc31101..da0d50d0c4ad6 100755 --- a/pulsar-client-cpp/pulsar-test-service-start.sh +++ b/pulsar-client-cpp/pulsar-test-service-start.sh @@ -82,6 +82,7 @@ $PULSAR_DIR/bin/pulsar-admin clusters list | grep -q '^standalone$' || $PULSAR_DIR/bin/pulsar-admin tenants update public -r "anonymous" -c "standalone" # Update "public/default" with no auth required +$PULSAR_DIR/bin/pulsar-admin namespaces create public/default $PULSAR_DIR/bin/pulsar-admin namespaces grant-permission public/default \ --actions produce,consume \ --role "anonymous"