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 '--host' parameter to 'restic forget' call in Prune jobs #698

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

ccremer
Copy link
Contributor

@ccremer ccremer commented Jun 28, 2022

Summary

The restic backup subcommand is using the --host parameter, but not when pruning.
This PR adds --host to the restic forget subcommand to make it more consistent.

See also https://restic.readthedocs.io/en/v0.13.1/060_forget.html#removing-snapshots-according-to-a-policy

Additionally, you can restrict the policy to only process snapshots which have a particular hostname with the --host parameter, or tags with the --tag option.

Fixes #686

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking,
    as they show up in the changelog
  • Update the documentation.
  • Update tests.
  • Link this PR to related issues.

The 'backup' subcommand is using the --host parameter, but not when pruning.
This should make it more consistent.

Signed-off-by: ccremer <github.account@chrigel.net>
@ccremer ccremer added the bug Something isn't working label Jun 28, 2022
@ccremer ccremer requested a review from a team as a code owner June 28, 2022 15:17
@ccremer ccremer requested review from bastjan and Kidswiss and removed request for a team and bastjan June 28, 2022 15:17
@ccremer
Copy link
Contributor Author

ccremer commented Jun 28, 2022

@Kidswiss Are you aware of any locations where documentation needs to be updated?

@ccremer
Copy link
Contributor Author

ccremer commented Jun 28, 2022

Also, I didn't do an in-depth test, I just ran make e2e-test locally and it passed.

@ccremer ccremer changed the title Add '--host' parameter to 'restic forget' call Add '--host' parameter to 'restic forget' call in Prune jobs Jun 28, 2022
Copy link
Contributor

@Kidswiss Kidswiss left a comment

Choose a reason for hiding this comment

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

LGTM

The docs only talk about backend here: https://k8up.io/k8up/2.3/references/object-specifications.html#_retention

It doesn't specify anything about on what namespaces it gets applied to. Maybe we could add a note that it is applied by namespace.

Signed-off-by: ccremer <github.account@chrigel.net>
@ccremer ccremer merged commit f45b4f3 into master Jun 29, 2022
@ccremer ccremer deleted the host-param branch June 29, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prune jobs not using --host in restic command
2 participants