Skip to content

Commit 3f91951

Browse files
flamingdumpsterJeff McCormick
authored andcommitted
Delete the pgdump pod once the backup has completed. (#752)
* Delete the pgdump pod once the backup has completed. * Change pgdump cleanup to remove job instead of just pod once completed
1 parent 8ffe4ed commit 3f91951

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

controller/jobcontroller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ func (c *JobController) onUpdate(oldObj, newObj interface{}) {
172172
log.Error("error in patching pgtask " + job.ObjectMeta.SelfLink + err.Error())
173173
}
174174

175+
// if job was successful, cleanup the job (and pod)
176+
if job.Status.Succeeded == 1 {
177+
kubeapi.DeleteJob(c.JobClientset, job.ObjectMeta.Name, c.Namespace)
178+
}
179+
175180
return
176181
}
177182

0 commit comments

Comments
 (0)