File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ package cmd
1616
1717import (
1818 "context"
19+ "strings"
1920 "time"
2021
2122 "github.com/spf13/cobra"
@@ -128,6 +129,9 @@ postgresclusters/hippo backup initiated`)
128129 )
129130
130131 if err != nil {
132+ if strings .Contains (err .Error (), "conflict" ) {
133+ cmd .Printf ("SUGGESTION: The --force-conflicts flag may help in performing this operation." )
134+ }
131135 cmd .Printf ("\n Error requesting update: %s\n " , err )
132136 return err
133137 }
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ func newRestoreCommand(config *internal.Config) *cobra.Command {
3333 cmd := & cobra.Command {
3434 Use : "restore CLUSTER_NAME" ,
3535 Short : "Restore cluster" ,
36- Long : `Restore the data of a PostgreSQL cluster from a backup
36+ Long : `Restore the data of a PostgreSQL cluster from a backup either by
37+ using the current "spec.backups.pgbackrest.restore" settings on the PostgreSQL
38+ cluster or by using flags to write your settings. Overwriting those settings
39+ may require the --force-conflicts flags.
3740
3841### RBAC Requirements
3942 Resources Verbs
@@ -190,6 +193,9 @@ func (config pgBackRestRestore) Run(ctx context.Context) error {
190193 config .PostgresCluster , types .ApplyPatchType , patch ,
191194 config .Patch .PatchOptions (patchOptions ))
192195 if err != nil {
196+ if strings .Contains (err .Error (), "conflict" ) {
197+ fmt .Fprintf (config .Out , "SUGGESTION: The --force-conflicts flag may help in performing this operation.\n " )
198+ }
193199 return err
194200 }
195201
You can’t perform that action at this time.
0 commit comments