From 8f418e9ae0eecb2d508adfab6a2bb9835a5124eb Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Tue, 3 Oct 2023 10:39:19 +0530 Subject: [PATCH 1/2] Fix logs bug Signed-off-by: Shashank Singh --- internal/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/util/util.go b/internal/util/util.go index d75562db..ca7de5c2 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -267,7 +267,7 @@ 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) } else { log.Errorf("Timed out awaiting reconciliation of volumesnapshot %s/%s", volSnap.Namespace, volSnap.Name) } From 1b2d4764006a69d1972b6fbd9d406f114b82d827 Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Tue, 3 Oct 2023 16:35:33 +0530 Subject: [PATCH 2/2] Returning actual error while snapshot timing out Signed-off-by: Shashank Singh --- internal/util/util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/util/util.go b/internal/util/util.go index ca7de5c2..793ab09f 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -268,6 +268,7 @@ func GetVolumeSnapshotContentForVolumeSnapshot(volSnap *snapshotv1api.VolumeSnap 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) + return nil, errors.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) } @@ -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) } }