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

Fail if the backup command in the annotation exits != 0 #1027

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

Kidswiss
Copy link
Contributor

@Kidswiss Kidswiss commented Dec 5, 2024

Summary

This will fix issues were problems with pre-backup go undected. K8up will now completely fail the whole whole prebackup pod if the commands exist with a code != 0.

Also a small issue with concurrent restic init was fixed.
Fixes: #910

Checklist

For Code changes

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • PR contains the label area:operator
  • Commits are signed off
  • Link this PR to related issues
  • I have not made any changes in the charts/ directory.

@Kidswiss Kidswiss requested a review from a team as a code owner December 5, 2024 15:17
@Kidswiss Kidswiss requested review from tobru and lieneluksika and removed request for a team December 5, 2024 15:17
@Kidswiss Kidswiss marked this pull request as draft December 5, 2024 15:17
@@ -262,16 +263,17 @@ func (b *BackupExecutor) startBackup(ctx context.Context) error {
}
// each job sleeps for index seconds to avoid concurrent restic repository creation. Not the prettiest way but it works and a repository
// is created only once usually.
if index > 0 {
if name == "prebackup" || index != 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes another small but unrelated issue.

If there's a PVC backup AND prebackup commands, it can happen that both want to restic init at the same time, which will corrupt the repo.

@Kidswiss Kidswiss force-pushed the fix/false-positive-backups branch 3 times, most recently from bd79e89 to b48d5f3 Compare December 9, 2024 07:43
@Kidswiss Kidswiss requested review from TheBigLee, wejdross and zugao and removed request for tobru and lieneluksika December 9, 2024 07:53
This will fix issues were problems with pre-backup go undected. K8up
will now completely fail the whole whole prebackup pod if the commands
exist with a code != 0.

Also a small issue with concurrent `restic init` was fixed.

Signed-off-by: Simon Beck <[email protected]>
@Kidswiss Kidswiss force-pushed the fix/false-positive-backups branch from b48d5f3 to 194e331 Compare December 9, 2024 07:55
@Kidswiss Kidswiss added bug Something isn't working area:operator labels Dec 9, 2024
@Kidswiss Kidswiss marked this pull request as ready for review December 9, 2024 07:56
@Kidswiss Kidswiss merged commit 29fc06f into master Dec 9, 2024
6 checks passed
@Kidswiss Kidswiss deleted the fix/false-positive-backups branch December 9, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:operator bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed backup stated as succeeded
2 participants