apache / pulsar-manager

Apache Pulsar Manager
https://pulsar.apache.org/
Apache License 2.0
521 stars 246 forks source link

feat: support seeding default superuser via application.properties #565

Closed maranmaran closed 6 months ago

maranmaran commented 6 months ago

Fixes #563

Motivation

I'm working on integrating apache pulsar into .NET Aspire Next to pulsar I wish to deliver a management UI, pulsar manager. Like Kafka and Rabbit do.

Here's my implementation

Right now, in order for me to seed default superuser, I must do this gymnastics of waiting for container and backend to be ready then acquire token, then issue put request.

This is clumsy a little and there should be a way to provide some default superuser via configuration. Like rabbit does, SQL, bunch of other tools.

In particular I'm afraid that Aspire team won't accept a solution like this one

Where I subscribe lifecycle hooks of container and then retry loop till I seed the user. It works, but it feels too "hacky"

Modifications

In PulsarApplicationListener implemented seedDefaultSuperuser Removed obsolete pulsar-manager.account

Verifying this change

maranmaran commented 6 months ago

👋 👋 @lhotari Hey man, some tiny hiccups, I just adjusted my IDE and am good to go. The build and tests should be okay now (./gradlew build ✅).

I have another branch ready to update docs about this change.

Additionally, I have experienced this https://github.com/apache/pulsar-manager/issues/567 and I can't run the backend. I have some proposal fix for it. Would you be so kind and just put some 👀 on the GH issue?