Skip to content

Commit

Permalink
Add --image-ref flag to fly pg backup restore. (#3759)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndarilek authored Jul 22, 2024
1 parent 1d9cc3f commit e7de84b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/command/postgres/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func newBackupRestore() *cobra.Command {
Description: "Set to true to stop recovery after the specified time, or false to stop before it",
Default: true,
},
flag.String{
Name: "image-ref",
Description: "Specify a non-default base image for the restored Postgres app",
},
)

return cmd
Expand Down Expand Up @@ -139,12 +143,17 @@ func runBackupRestore(ctx context.Context) error {
return err
}

imageRef := flag.GetString(ctx, "image-ref")
if imageRef == "" {
imageRef = leader.FullImageRef()
}

// Build the input for the new cluster using the leader's configuration.
input := &flypg.CreateClusterInput{
AppName: destAppName,
Organization: org,
InitialClusterSize: 1,
ImageRef: leader.FullImageRef(),
ImageRef: imageRef,
Region: leader.Region,
Manager: flypg.ReplicationManager,
Autostart: *leader.Config.Services[0].Autostart,
Expand Down

0 comments on commit e7de84b

Please sign in to comment.