Skip to content

Commit

Permalink
rpk: bugfix - filter in list-mount
Browse files Browse the repository at this point in the history
We should default to filter `all`, otherwise we
won't print any operation unless a filter is
provided.
  • Loading branch information
r-vasquez committed Nov 15, 2024
1 parent 26e5aa3 commit 8650b26
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/cli/cluster/storage/cancel-mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Cancel a mount/unmount operation
out.MaybeDie(err, "unable to cancel the mount/unmount operation: %v", err)
}

fmt.Printf("Successfully canceled the operation with ID %v", migrationID)
fmt.Printf("Successfully canceled the operation with ID %v\n", migrationID)
},
}
return cmd
Expand Down
8 changes: 5 additions & 3 deletions src/go/rpk/pkg/cli/cluster/storage/list-mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Use filter to list only migrations in a specific state
},
}
p.InstallFormatFlag(cmd)
cmd.Flags().StringVarP(&filter, "filter", "f", "", "Filter the list of migrations by state. Only valid for text")
cmd.Flags().StringVarP(&filter, "filter", "f", "all", "Filter the list of migrations by state. Only valid for text")
return cmd
}

Expand Down Expand Up @@ -166,9 +166,11 @@ func rpadminTopicsToStringSlice(in []rpadmin.NamespacedOrInboundTopic) (resp []s
for _, entry := range in {
if entry.Namespace != nil {
resp = append(resp, fmt.Sprintf("%s/%s", *entry.Namespace, entry.Topic))
continue
} else if entry.SourceTopicReference.Topic != "" {
resp = append(resp, entry.SourceTopicReference.Topic)
} else {
resp = append(resp, entry.Topic)
}
resp = append(resp, entry.Topic)
}
return
}
Expand Down
9 changes: 5 additions & 4 deletions src/go/rpk/pkg/cli/cluster/storage/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ with my-new-topic as the new topic name
id = mg.ID
}

fmt.Printf(`
Topic mount from Tiered Storage topic %v to your Redpanda Cluster topic %v
has started with Migration ID %v
To check the status run 'rpk cluster storage status-mount %d`+"\n", t, alias, id, id)
fmt.Printf(`Topic mount from Tiered Storage topic %q to your Redpanda Cluster topic %q
has started with Migration ID %v.
To check the status run 'rpk cluster storage status-mount %d.
`, t, alias, id, id)
},
}
cmd.Flags().StringVar(&to, "to", "", "New namespace/topic name for the mounted topic (optional)")
Expand Down
9 changes: 5 additions & 4 deletions src/go/rpk/pkg/cli/cluster/storage/unmount.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ Unmount topic 'my-topic' from the cluster in the 'my-namespace'
id = mg.ID
}

fmt.Printf(`
Topic unmounting from your Redpanda Cluster topic %v
has started with Migration ID %v
To check the status run 'rpk cluster storage status-mount %d`+"\n", t, id, id)
fmt.Printf(`Topic unmounting from your Redpanda Cluster topic %q has started with
Migration ID %v.
To check the status run 'rpk cluster storage status-mount %d.
`, t, id, id)
},
}
return cmd
Expand Down

0 comments on commit 8650b26

Please sign in to comment.