-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Don't log error if restic volume is empty #1480
Conversation
8d914c2
to
ef30ee2
Compare
@carlisia it definitely looks to me like the error is occurring on L232-233 in the pod volume backup controller. Here's the error I see in the log of the restic pod that ran the backup:
Remember, the pod volume backup controller is not running in the main velero deployment pod; it's running in the restic daemonset. So I think that's the appropriate place to check for this error, not in Additionally, we need to decide what to do with the |
I know why I didn't see the changes I had made to ln |
As for the phase: this is not a failure. So it leaves us with |
So, couple things:
|
ef30ee2
to
007cc3e
Compare
Signed-off-by: Carlisia <carlisiac@vmware.com>
007cc3e
to
836d4d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, two small comments. Let's add a changelog for this as well.
pkg/restic/backupper.go
Outdated
@@ -168,6 +168,10 @@ ForEachVolume: | |||
case res := <-resultsChan: | |||
switch res.Status.Phase { | |||
case velerov1api.PodVolumeBackupPhaseCompleted: | |||
if res.Status.SnapshotID == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a comment here explaining that this would be the case if the volume was empty and therefore we don't actually have a restic snapshot, since it's not immediately obvious.
r.Status.Phase = velerov1api.PodVolumeBackupPhaseCompleted | ||
r.Status.SnapshotID = snapshotID | ||
if emptySnapshot { | ||
r.Status.Message = "backup completed with an empty volume" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something like "volume was empty so no snapshot was taken" would be slightly clearer?
Signed-off-by: Carlisia <carlisiac@vmware.com>
56606f3
to
4f01b50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can be squashed on merge.
Fixes #1266.
Couple of notes:
I thought this error would happen here: https://github.com/heptio/velero/blob/ee8f8ca1db5917b631547b5f59e4075caee66b20/pkg/controller/pod_volume_backup_controller.go#L233
But the execution path doesn't go thru there.
I made small mods to some error messages to make them different from one another. Let me know if it's best to leave them as they were.
Signed-off-by: Carlisia carlisiac@vmware.com