Skip to content

Conversation

@caitlinstrong
Copy link
Contributor

Removing the repo backup schedule from the cluster spec will delete the cronJob(s) associated with the backup schedule.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

When a backup has a cron scheduled, for example:

spec:
  backups:
    pgbackrest:
      repos:
      - name: repo1
        schedules:
          full: "0 1 * * 0"
          differential: "0 1 * * 1-6"

Removing the backup schedule from the cluster configuration and applying the changes does not automatically delete the cronJob associated with the backup schedule. The cronJob must be manually deleted for the schedule to be removed.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

To address this issue, I've changed the position of the case statement for the cronJob in the function cleanupRepoResources. With this change, cronJobs are automatically deleted when the repo backup schedule is removed from the cluster spec.

Other Information:

@caitlinstrong caitlinstrong merged commit 072a19d into CrunchyData:main Jan 28, 2025
16 of 18 checks passed
@caitlinstrong caitlinstrong deleted the cron-removal branch January 28, 2025 21:13
@caitlinstrong caitlinstrong self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants