Skip to content

Commit ea6f45e

Browse files
andrewlecuyerjkatz
authored andcommitted
Updates the job controller to only process backrest
backup jobs if they are not currently being deleted (e.g. as the result of a foreground deletion).
1 parent 0fb5f35 commit ea6f45e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

controller/jobcontroller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ func (c *JobController) onUpdate(oldObj, newObj interface{}) {
260260
}
261261

262262
//handle the case of a backrest job being added
263-
if labels[config.LABEL_BACKREST] == "true" && labels[config.LABEL_BACKREST_COMMAND] == "backup" {
263+
if !isForegroundDeletion && labels[config.LABEL_BACKREST] == "true" &&
264+
labels[config.LABEL_BACKREST_COMMAND] == "backup" {
264265
log.Debugf("jobController onUpdate backrest job case")
265266
log.Debugf("got a backrest job status=%d", job.Status.Succeeded)
266267
if job.Status.Succeeded == 1 {
@@ -305,7 +306,7 @@ func (c *JobController) onUpdate(oldObj, newObj interface{}) {
305306
}
306307
if clusterStatus == crv1.PgclusterStateRestore {
307308
pgreplica.Spec.Status = "restore"
308-
} else {
309+
} else {
309310
pgreplica.Annotations[config.ANNOTATION_PGHA_BOOTSTRAP_REPLICA] = "true"
310311
}
311312
err = kubeapi.Updatepgreplica(c.JobClient, &pgreplica, pgreplica.Name, job.ObjectMeta.Namespace)

0 commit comments

Comments
 (0)