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

Fix Error log bug #207

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ func GetVolumeSnapshotContentForVolumeSnapshot(volSnap *snapshotv1api.VolumeSnap
if err != nil {
if err == wait.ErrWaitTimeout {
if snapshotContent.Status != nil && snapshotContent.Status.Error != nil {
log.Errorf("Timed out awaiting reconciliation of volumesnapshot, Volumesnapshotcontent %s has error: %v", snapshotContent.Name, snapshotContent.Status.Error.Message)
log.Errorf("Timed out awaiting reconciliation of volumesnapshot, Volumesnapshotcontent %s has error: %v", snapshotContent.Name, *snapshotContent.Status.Error.Message)
return nil, errors.Errorf("CSI got timed out with error: %v", *snapshotContent.Status.Error.Message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

unsure about this return statement here, we return on line 276 with the original error, right ?

Copy link
Author

@Shashank1306s Shashank1306s Oct 16, 2023

Choose a reason for hiding this comment

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

Hi @shubham-pampattiwar, here in line 268 the err is compared to wait.ErrWaitTimeout which is timed out waiting for the condition

and while returning this error message is floated in the velero rather than actual error.
So, I've added this return statement for floating actual error

} else {
log.Errorf("Timed out awaiting reconciliation of volumesnapshot %s/%s", volSnap.Namespace, volSnap.Name)
}
Expand Down Expand Up @@ -401,7 +402,7 @@ func CleanupVolumeSnapshot(volSnap *snapshotv1api.VolumeSnapshot, snapshotClient
if err != nil {
log.Debugf("Failed to delete volumesnapshot %s/%s: %v", vs.Namespace, vs.Name, err)
} else {
log.Info("Deleted volumesnapshot with volumesnapshotContent %s/%s", vs.Namespace, vs.Name)
log.Infof("Deleted volumesnapshot with volumesnapshotContent %s/%s", vs.Namespace, vs.Name)
}
}

Expand Down
Loading