Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--tls-allow-insecure breaks argument parsing #711

Open
addisonj opened this issue May 17, 2022 · 1 comment
Open

--tls-allow-insecure breaks argument parsing #711

addisonj opened this issue May 17, 2022 · 1 comment

Comments

@addisonj
Copy link

When passing --tls-allow-insecure in a command like:

pulsarctl --tls-allow-insecure true --admin-service-url https://xxx --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken --auth-params="token:xxx" namespaces list public
[✖]  the tenant name is not specified or the tenant name is specified more than one

We get an error.

In the help, it doesn't seem like you need -tls-allow-insecure true but if you don't include the true, and do the following:

pulsarctl --tls-allow-insecure --admin-service-url https://xxx --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken --auth-params="token:xxx" namespaces list public 
Error: unknown command "https://xxx" for "pulsarctl"
Run 'pulsarctl --help' for usage.
unknown command "https://xxx" for "pulsarctl"

The --tls-allow-insecure is chomping the next argument

The following does work:

pulsarctl --admin-service-url https:/xxx --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken --auth-params="token:xxx namespaces list public --tls-allow-insecure     
+----------------+
| NAMESPACE NAME |
+----------------+
| public/default |
+----------------+

But it is pretty awkward.

@nodece
Copy link
Contributor

nodece commented May 18, 2022

Thanks for your feedback, the right way:

pulsarctl namespaces list public --tls-allow-insecure --admin-service-url https:/xxx --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken --auth-params="token:xxx"

pulsarctl namespaces list public --tls-allow-insecure=true --admin-service-url https:/xxx --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken --auth-params="token:xxx"

Don't use any flags before subcommand, because these flags are registered in subcommand, you can see the common flags from root command.

➜  pulsarctl git:(master) pulsarctl -h
a CLI for Apache Pulsar

Usage: pulsarctl [command] [flags]

Commands:
  bookkeeper            Operations about bookKeeper
  broker-stats          Operations to collect broker statistics
  brokers               Operations about broker(s)
  clusters              Operations about cluster(s)
  completion            Generates shell completion scripts
  context               Interface for setting Pulsar Context 
  functions             Interface for managing Pulsar Functions (lightweight, Lambda-style compute processes that work with Pulsar)
  functions-worker      Operations to collect function-worker statistics
  help                  Help about any command
  namespaces            Operations about namespaces
  ns-isolation-policy   Operations about namespace isolation policy
  oauth2                Operations about oauth2
  packages              Operations about packages
  plugin                Operations about plugins
  resource-quotas       Operations about resource quotas
  schemas               Operations related to Schemas associated with Pulsar topics
  sinks                 Interface for managing Pulsar IO sinks (egress data from Pulsar)
  sources               Interface for managing Pulsar IO Sources (ingress data into Pulsar)
  subscriptions         Operations about subscription(s)
  tenants               Operations about tenant(s)
  token                 Operations of token
  topics                Operations about topic(s)

Common flags:
  -C, --fabulous string   toggle colorized logs (true,false,fabulous) (default "true")
  -h, --help              help for this command
  -v, --verbose int       set log level, use 0 to silence, 4 for debugging (default 3)
  -V, --version           show the pulsarctl version informantion

Use 'pulsarctl [command] --help' for more information about a command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants