Skip to content

Commit 80b0849

Browse files
committed
kadm: fix ListTopics filtering internal topics when explicitly requested
ListTopics was unconditionally filtering internal topics even when specific topic names were provided. This violated the documented behavior that internal topics should be included when explicitly requested by name. This fix only applies FilterInternal when listing all topics (no specific topics requested), allowing explicitly named internal topics like __consumer_offsets to be returned as documented.
1 parent a09f0e7 commit 80b0849

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/kadm/topics.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ func (cl *Client) ListTopics(
2626
if err != nil {
2727
return nil, err
2828
}
29-
t.FilterInternal()
29+
// Only filter internal topics when listing all topics (no specific topics requested).
30+
// If specific topics are named, include them even if they are internal.
31+
if len(topics) == 0 {
32+
t.FilterInternal()
33+
}
3034
return t, nil
3135
}
3236

0 commit comments

Comments
 (0)