File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ type Options struct {
3535type topicRow struct {
3636 Name string `json:"name,omitempty" header:"Name"`
3737 PartitionsCount int `json:"partitions_count,omitempty" header:"Partitions"`
38+ RetentionTime string `json:"retention.ms,omitempty" header:"Retention time"`
39+ RetentionSize string `json:"retention.bytes,omitempty" header:"Retention size"`
3840}
3941
4042// NewListTopicCommand gets a new command for getting kafkas.
@@ -168,9 +170,22 @@ func mapTopicResultsToTableFormat(topics []strimziadminclient.Topic) []topicRow
168170 var rows []topicRow = []topicRow {}
169171
170172 for _ , t := range topics {
173+ var RetentionTime , RetentionSize string
174+
175+ for _ , config := range t .GetConfig () {
176+ if * config .Key == "retention.ms" {
177+ RetentionTime = * config .Value
178+ }
179+ if * config .Key == "retention.bytes" {
180+ RetentionSize = * config .Value
181+ }
182+ }
183+
171184 row := topicRow {
172185 Name : t .GetName (),
173186 PartitionsCount : len (t .GetPartitions ()),
187+ RetentionTime : RetentionTime ,
188+ RetentionSize : RetentionSize ,
174189 }
175190 rows = append (rows , row )
176191 }
You can’t perform that action at this time.
0 commit comments