velero: don't error when taking a restic backup if volume is empty
restic
returns an error if you try to take a snapshot of an empty directory. I think for Velero’s purposes this should not be reported to the user as an error. We should either check the contents of the volume beforehand, or check for this specific error and handle it gracefully.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (17 by maintainers)
If you follow all those steps and can’t repro, let me know and we can pair.
I just repro’ed this in my test cluster. I installed velero using
--with-restic
, deployed the nginx example, added thebackup.velero.io/backup-volumes=nginx-logs
annotation to the nginx pod, and exec’ed into the pod and deleted all contents of/var/log/nginx
.Here’s what I get in the backup log:
And here’s an abridged version of
velero backup describe
for the backup:Nope – that looks like the log file didn’t get uploaded to object storage – is your backup Completed?
The error message you’re looking for says something like “empty snapshot” – don’t remember the exact text. It’s pretty clear.