Repository navigation
Fail folder restores when restic restore exits non-zero - #1289
Open
sarankumar1325 wants to merge 1 commit into
Open
sarankumar1325 wants to merge 1 commit into
sarankumar1325 wants to merge 1 commit into
Conversation
folderRestore ran restic restore and always returned nil, so a failed or partial restore was reported as Succeeded and still sent the webhook. Return the command's FatalError like the other restic wrappers do. Fixes k8up-io#1263 Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>
sarankumar1325
requested review from
TheBigLee and
arska
and removed request for
a team
October 29, 2026 13:54
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
folderRestoreinrestic/cli/restore.goranrestic restoreand then returnednilno matter what. A failed or partial folder restore (for example restic failing tochmodfiles owned by another uid) was reported asCompleted=True/Succeeded, the Job completed,k8up_jobs_failed_counterdid not move, and the restore webhook was still sent.cmd.FatalError, the same as the other restic wrappers (backup.go,check.go,init.go,prune.go,snapshots.go,unlock.go).Restore()already skips the webhook and passes the error on when this is set.restic/cli/restore_test.go. It runsRestore()against a small fakeresticscript: a successful restore returns nil and sends the webhook, and a restore that exits 1 returns an error and sends no webhook. The failure case fails onmasterand passes with this change.Tests:
go test ./restic/...,go vet ./restic/cli/,golangci-lint run ./restic/cli/(0 issues).Fixes #1263
I wrote this with help from an AI coding assistant, and I reviewed and tested the change.
Checklist
For Code changes
bug,enhancement,documentation,change,breaking,dependencyas they show up in the changelog (suggested:
bug; I can't set labels from a fork)area:operator(needs a maintainer, I can't set labels from a fork)charts/directory.