Skip to content

Commit 1ff1d24

Browse files
committed
Reconcile cronjobs with cluster config file
1 parent 808b5f5 commit 1ff1d24

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

internal/controller/postgrescluster/pgbackrest.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,6 @@ func (r *Reconciler) cleanupRepoResources(ctx context.Context,
345345
delete = false
346346
}
347347
}
348-
case hasLabel(naming.LabelPGBackRestBackup):
349-
if !backupsSpecFound {
350-
break
351-
}
352-
// If a Job is identified for a repo that no longer exists in the spec then
353-
// delete it. Otherwise add it to the slice and continue.
354-
for _, repo := range postgresCluster.Spec.Backups.PGBackRest.Repos {
355-
if repo.Name == owned.GetLabels()[naming.LabelPGBackRestRepo] {
356-
ownedNoDelete = append(ownedNoDelete, owned)
357-
delete = false
358-
}
359-
}
360348
case hasLabel(naming.LabelPGBackRestCronJob):
361349
if !backupsSpecFound {
362350
break
@@ -371,6 +359,18 @@ func (r *Reconciler) cleanupRepoResources(ctx context.Context,
371359
break
372360
}
373361
}
362+
case hasLabel(naming.LabelPGBackRestBackup):
363+
if !backupsSpecFound {
364+
break
365+
}
366+
// If a Job is identified for a repo that no longer exists in the spec then
367+
// delete it. Otherwise add it to the slice and continue.
368+
for _, repo := range postgresCluster.Spec.Backups.PGBackRest.Repos {
369+
if repo.Name == owned.GetLabels()[naming.LabelPGBackRestRepo] {
370+
ownedNoDelete = append(ownedNoDelete, owned)
371+
delete = false
372+
}
373+
}
374374
case hasLabel(naming.LabelPGBackRestRestore):
375375
if !backupsSpecFound {
376376
break

0 commit comments

Comments
 (0)