Skip to content

Commit 52b578e

Browse files
andrewlecuyerJonathan S. Katz
authored andcommitted
Handle & Log Initial Backup Creation Errors
Errors are now handled and logged when creating an initial cluster backup pgtask following a successful stanza-create Job.
1 parent 744b9b5 commit 52b578e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/controller/job/backresthandler.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,11 @@ func (c *Controller) handleBackrestStanzaCreateUpdate(job *apiv1.Job) error {
226226
return err
227227
}
228228

229-
backrestoperator.CreateInitialBackup(c.Client, job.ObjectMeta.Namespace,
230-
clusterName, backrestRepoPodName)
229+
if _, err := backrestoperator.CreateInitialBackup(c.Client, job.ObjectMeta.Namespace,
230+
clusterName, backrestRepoPodName); err != nil {
231+
log.Error(err)
232+
return err
233+
}
231234

232235
// now that the initial backup has been initiated, proceed with deleting the stanza-create
233236
// pgtask and associated Job. This will ensure any subsequent updates to the stanza-create

0 commit comments

Comments
 (0)