Skip to content

Commit 66ffebe

Browse files
andrewlecuyerjkatz
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 a0bc139 commit 66ffebe

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
@@ -167,8 +167,11 @@ func (c *Controller) handleBackrestStanzaCreateUpdate(job *apiv1.Job) error {
167167
return err
168168
}
169169

170-
_, _ = backrest.CreateInitialBackup(c.Client, job.ObjectMeta.Namespace,
171-
clusterName, backrestRepoPodName)
170+
if _, err := backrest.CreateInitialBackup(c.Client, job.ObjectMeta.Namespace,
171+
clusterName, backrestRepoPodName); err != nil {
172+
log.Error(err)
173+
return err
174+
}
172175

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

0 commit comments

Comments
 (0)