Skip to content

Commit

Permalink
Merge pull request #910 from ripienaar/restore_set_replicas
Browse files Browse the repository at this point in the history
Allow replicas to be set when doing restores
  • Loading branch information
ripienaar authored Oct 25, 2023
2 parents d7059bd + 9112f57 commit e938753
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/stream_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ Finding streams with certain subjects configured:
strRestore.Flag("config", "Load a different configuration when restoring the stream").ExistingFileVar(&c.inputFile)
strRestore.Flag("cluster", "Place the stream in a specific cluster").StringVar(&c.placementCluster)
strRestore.Flag("tag", "Place the stream on servers that has specific tags (pass multiple times)").StringsVar(&c.placementTags)
strRestore.Flag("replicas", "Override how many replicas of the data to create").Int64Var(&c.replicas)

strSeal := str.Command("seal", "Seals a stream preventing further updates").Action(c.sealAction)
strSeal.Arg("stream", "The name of the Stream to seal").Required().StringVar(&c.stream)
Expand Down Expand Up @@ -986,6 +987,10 @@ func (c *streamCmd) restoreAction(_ *fisk.ParseContext) error {
}
}

if c.replicas > 0 {
cfg.Replicas = int(c.replicas)
}

opts = append(opts, jsm.RestoreConfiguration(*cfg))

fmt.Printf("Starting restore of Stream %q from file %q\n\n", bm.Config.Name, c.backupDirectory)
Expand Down

0 comments on commit e938753

Please sign in to comment.