Skip to content

Optional backups v2 #3977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 29, 2024
Merged

Optional backups v2 #3977

merged 13 commits into from
Aug 29, 2024

Conversation

benjaminjb
Copy link
Contributor

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)?

Backups are required

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

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

Backups are optional

Other Information:
Issues: [PGO-1529]

@@ -2915,3 +3007,92 @@ func (r *Reconciler) reconcilePGBackRestCronJob(
}
return err
}

// BackupsEnabled checks the state of the backups (i.e., if backups are in the spec,
// if a repo-host StatefulSet exists, if the annotation permitting backup deletion exist)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// if a repo-host StatefulSet exists, if the annotation permitting backup deletion exist)
// if a repo-host StatefulSet exists, if the annotation permitting backup deletion exists)

@@ -382,6 +439,24 @@ func unstructuredToRepoResources(kind string, repoResources *RepoResources,
uList *unstructured.UnstructuredList) error {

switch kind {
Copy link
Contributor Author

@benjaminjb benjaminjb Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's several changes here because I reordered these cases to match the order of the list where we get these items (in getPGBackRestResources).

@@ -343,6 +394,12 @@ func (r *Reconciler) cleanupRepoResources(ctx context.Context,
ownedNoDelete = append(ownedNoDelete, owned)
delete = false
}
case hasLabel(naming.LabelPGBackRest):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this to take care of RBAC and other items not caught by the previous cases.

@benjaminjb benjaminjb merged commit 69869d2 into master Aug 29, 2024
13 checks passed
@benjaminjb benjaminjb deleted the optional-backups-v2 branch August 29, 2024 17:48
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