Skip to content

Commit 6c07bfd

Browse files
committed
rpk: support cluster-uuid-override with WCR
1 parent 0ea9899 commit 6c07bfd

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/go/rpk/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/prometheus/client_model v0.6.2
4949
github.com/prometheus/common v0.65.0
5050
github.com/redpanda-data/common-go/proto v0.0.0-20250820120127-9b518fca5ecf
51-
github.com/redpanda-data/common-go/rpadmin v0.2.0
51+
github.com/redpanda-data/common-go/rpadmin v0.2.1
5252
github.com/redpanda-data/common-go/rpsr v0.1.2
5353
github.com/redpanda-data/protoc-gen-go-mcp v0.0.0-20250812151819-7e5d5fef8241
5454
github.com/rs/xid v1.6.0

src/go/rpk/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ github.com/redpanda-data/common-go/net v0.1.0 h1:JnJioRJuL961r1QXiJQ1tW9+yEaJfu8
253253
github.com/redpanda-data/common-go/net v0.1.0/go.mod h1:iOdNkjxM7a1T8F3cYHTaKIPFCHzzp/ia6TN+Z+7Tt5w=
254254
github.com/redpanda-data/common-go/proto v0.0.0-20250820120127-9b518fca5ecf h1:Oe0Sc3+/37Xgdpze7klkWyvB6eAt/nuUhrn93Rd4ESA=
255255
github.com/redpanda-data/common-go/proto v0.0.0-20250820120127-9b518fca5ecf/go.mod h1:GMoRcdMz6CIpr+8vKrSJvr8fJDlojETRV45BD6A0DvU=
256-
github.com/redpanda-data/common-go/rpadmin v0.2.0 h1:s2MyyY+yq7B17mLjjW17RO81wFlzo856K9IuBpsmvv0=
257-
github.com/redpanda-data/common-go/rpadmin v0.2.0/go.mod h1:qmu76v7RRKgEXLS3UXxZ8KDpObtSNq6RinOIejJNWzw=
256+
github.com/redpanda-data/common-go/rpadmin v0.2.1 h1:N3GUI3d1h661Nta6Jc4MyaVKWxRIg28yO4MG912gCXQ=
257+
github.com/redpanda-data/common-go/rpadmin v0.2.1/go.mod h1:qmu76v7RRKgEXLS3UXxZ8KDpObtSNq6RinOIejJNWzw=
258258
github.com/redpanda-data/common-go/rpsr v0.1.2 h1:DThUeyfBH8fkL9WoP1sEbRhT2NVV22zmsTpcCtzfusQ=
259259
github.com/redpanda-data/common-go/rpsr v0.1.2/go.mod h1:2j2416onosg5FKaKz52NooRE+q/9EJqQn0kyTcTXWHc=
260260
github.com/redpanda-data/go-avro/v2 v2.0.0-20240405204525-77b1144dc525 h1:vskZrV6q8W8flL0Ud23AJUYAd8ZgTadO45+loFnG2G0=

src/go/rpk/pkg/cli/cluster/storage/recovery/start.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func newStartCommand(fs afero.Fs, p *config.Params) *cobra.Command {
2626
var (
2727
wait bool
2828
pollingInterval time.Duration
29+
uuidOverride string
2930
)
3031

3132
cmd := &cobra.Command{
@@ -35,7 +36,10 @@ func newStartCommand(fs afero.Fs, p *config.Params) *cobra.Command {
3536
3637
This command starts the process of restoring topics from the archival bucket.
3738
If the wait flag (--wait/-w) is set, the command will poll the status of the
38-
recovery process until it's finished.`,
39+
recovery process until it's finished.
40+
41+
Use --cluster-uuid-override if the cluster was re-initialized after the backup,
42+
causing multiple cluster UUIDs to exist in the bucket.`,
3943
Args: cobra.NoArgs,
4044
Run: func(cmd *cobra.Command, _ []string) {
4145
p, err := p.LoadVirtualProfile(fs)
@@ -47,7 +51,7 @@ recovery process until it's finished.`,
4751

4852
ctx := cmd.Context()
4953

50-
_, err = client.StartAutomatedRecovery(ctx)
54+
_, err = client.StartAutomatedRecovery(ctx, uuidOverride)
5155
var he *rpadmin.HTTPResponseError
5256
if errors.As(err, &he) {
5357
if he.Response.StatusCode == 404 {
@@ -113,6 +117,7 @@ recovery process until it's finished.`,
113117
cmd.Flags().MarkDeprecated("topic-name-pattern", "Not supported")
114118
cmd.Flags().BoolVarP(&wait, "wait", "w", false, "Wait until auto-restore is complete")
115119
cmd.Flags().DurationVar(&pollingInterval, "polling-interval", 5*time.Second, "The status check interval (e.g. '30s', '1.5m'); ignored if --wait is not used")
120+
cmd.Flags().StringVar(&uuidOverride, "cluster-uuid-override", "", "Cluster UUID to restore from")
116121

117122
return cmd
118123
}

0 commit comments

Comments
 (0)