Skip to content

[fix][cli] Fix V5 scalable-topics property parsing#26177

Open
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix/v5-scalable-topics-cli-properties
Open

[fix][cli] Fix V5 scalable-topics property parsing#26177
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix/v5-scalable-topics-cli-properties

Conversation

@void-ptr974

Copy link
Copy Markdown
Contributor

Fixes #26176

Motivation

The V5 scalable-topics CLI consumed the topic or namespace argument as a -p / --property value when -p was placed before the positional argument.

Examples:

pulsar-admin scalable-topics create -p app=cli topic://public/default/t1
pulsar-admin scalable-topics list -p app=cli public/default

Modifications

  • Make -p / --property consume one value per occurrence.
  • Keep repeated -p key=value support.
  • Support comma-separated properties, such as -p key=value,key2=value2.
  • Add CLI parser tests for create and list.

After this change, both forms are accepted:

pulsar-admin scalable-topics create -p app=cli -p mode=blackbox topic://public/default/t1
pulsar-admin scalable-topics create -p app=cli,mode=blackbox topic://public/default/t1

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • ./gradlew --no-daemon :pulsar-client-tools:test --tests org.apache.pulsar.admin.cli.TestCmdScalableTopics
  • ./gradlew --no-daemon :pulsar-client-tools:checkstyleMain :pulsar-client-tools:checkstyleTest

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

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

Successfully merging this pull request may close these issues.

[Bug] V5 scalable-topics CLI consumes topic or namespace arguments as properties

1 participant