Fixed TTL error
This commit is contained in:
parent
809fdc659f
commit
145209b051
@ -361,13 +361,14 @@ func (r *BackupSessionReconciler) CreateBackupJob(target formolv1alpha1.Target)
|
||||
}
|
||||
// S3 backing storage
|
||||
restic.Env = append(restic.Env, formolutils.ConfigureResticEnvVar(r.BackupConf, repo)...)
|
||||
jobTtl := JOBTTL
|
||||
job := &batchv1.Job{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
GenerateName: fmt.Sprintf("%s-%s-", r.BackupSession.Name, target.Name),
|
||||
Namespace: r.BackupConf.Namespace,
|
||||
},
|
||||
Spec: batchv1.JobSpec{
|
||||
TTLSecondsAfterFinished: &JOBTTL,
|
||||
TTLSecondsAfterFinished: &jobTtl,
|
||||
Template: corev1.PodTemplateSpec{
|
||||
Spec: corev1.PodSpec{
|
||||
InitContainers: []corev1.Container{},
|
||||
@ -431,13 +432,14 @@ func (r *BackupSessionReconciler) deleteExternalResources() error {
|
||||
}
|
||||
// create a job to delete the restic snapshot(s) with the backupsession name tag
|
||||
if len(deleteSnapshots) > 0 {
|
||||
jobTtl := JOBTTL
|
||||
job := &batchv1.Job{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
GenerateName: fmt.Sprintf("delete-%s-", r.BackupSession.Name),
|
||||
Namespace: r.BackupSession.Namespace,
|
||||
},
|
||||
Spec: batchv1.JobSpec{
|
||||
TTLSecondsAfterFinished: &JOBTTL,
|
||||
TTLSecondsAfterFinished: &jobTtl,
|
||||
Template: corev1.PodTemplateSpec{
|
||||
Spec: corev1.PodSpec{
|
||||
InitContainers: []corev1.Container{},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user