Skip to content

Commit

Permalink
Merge pull request #221 from blackpiglet/cherry_pick_215
Browse files Browse the repository at this point in the history
Fix panic when csi timeout duration is short
  • Loading branch information
shubham-pampattiwar authored Jan 2, 2024
2 parents 9b2a9bb + 4eeb5a3 commit 18cc41e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ 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)
if snapshotContent != nil && 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)
err = fmt.Errorf("CSI got timed out with error: %v", *snapshotContent.Status.Error.Message)
} else {
log.Errorf("Timed out awaiting reconciliation of volumesnapshot %s/%s", volSnap.Namespace, volSnap.Name)
}
Expand Down

0 comments on commit 18cc41e

Please sign in to comment.