Skip to content
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

Add ability to store resources. #44

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Add ability to store resources. #44

merged 1 commit into from
Feb 2, 2024

Conversation

gianlucam76
Copy link
Owner

Cleaner has an optional field StoreResourcePath When set, Cleaner will dump all matching resources before any modification (delete or updated) was done. ResourceVersion is reset.

This allows admin to have a backup of all resources Cleaner deletes/modifies in case there is a need to restore those back.

For instance

- apiVersion: apps.projectsveltos.io/v1alpha1
  kind: Cleaner
  metadata:
    name: deployment-with-zero-replicas
  spec:
    storeResourcePath: /collection
    ...

Will store all resources

/collection/deployment-with-zero-replicas/<resourceNamespace>/<resource Kind>/<resource Name>.yaml

Fixes #43

Cleaner has an optional field __StoreResourcePath__
When set, Cleaner will dump all matching resources before any modification
(delete or updated) was done. ResourceVersion is reset.

This allows admin to have a backup of all resources Cleaner deletes/modifies
in case there is a need to restore those back.

For instance

```yaml
- apiVersion: apps.projectsveltos.io/v1alpha1
  kind: Cleaner
  metadata:
    name: deployment-with-zero-replicas
  spec:
    storeResourcePath: /collection
    ...
```

Will store all resources

```
/collection/deployment-with-zero-replicas/<resourceNamespace>/<resource Kind>/<resource Name>.yaml
```
@gianlucam76 gianlucam76 merged commit e2f4937 into main Feb 2, 2024
3 checks passed
@gianlucam76 gianlucam76 deleted the restore branch February 2, 2024 13:21
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.

Ability to roll back deletions
1 participant