redpanda icon indicating copy to clipboard operation
redpanda copied to clipboard

Regression: `rpk topic consume --regex` never works

Open brasic opened this issue 1 year ago • 0 comments

Version & Environment

Redpanda version: (use rpk version): 23.3.12

What went wrong?

rpk topic consume --regex always fails if any non-literal chars are used. For example, the following command against a broker with at least one topic should return data instead of failing:

$ rpk topic consume --regex '.*'
unable to consume topic ".*": UNKNOWN_TOPIC_OR_PARTITION: This server does not host this topic-partition.

It looks like this regressed in https://github.com/redpanda-data/redpanda/pull/13330, which validates that topics exist before consuming them, but when --regex is passed the topics are to be interpreted as patterns instead of literal values.

What should have happened instead?

--regex flag should disable the topic existence validation added in https://github.com/redpanda-data/redpanda/pull/13330

How to reproduce the issue?

  1. Create a topic of any name
  2. rpk topic consume --regex '.*'
  3. Observe UNKNOWN_TOPIC_OR_PARTITION error

JIRA Link: CORE-3047

brasic avatar May 21 '24 19:05 brasic