Skip to content

Commit 4fce425

Browse files
committed
Change error code for create snapshot to a non-final error
1 parent 1fb8c4c commit 4fce425

File tree

2 files changed

+496
-1
lines changed

2 files changed

+496
-1
lines changed

pkg/csi/service/wcpguest/controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,11 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
16471647
msg := fmt.Sprintf("volumesnapshot: %s on namespace: %s in supervisor cluster was not Ready. "+
16481648
"Error: %+v", supervisorVolumeSnapshotName, c.supervisorNamespace, err)
16491649
log.Error(msg)
1650-
return nil, status.Error(codes.Internal, msg)
1650+
// Note: Set the return code to codes.DeadlineExceeded if VolumeSnapshot is still not ready
1651+
// to indicate that the snapshot creation has timed out
1652+
// so that external-snapshotter will keep retrying and won't leave
1653+
// orphan snapshots behind.
1654+
return nil, status.Error(codes.DeadlineExceeded, msg)
16511655
}
16521656
// Extract the fcd-id + snapshot-id annotation from the supervisor volumesnapshot CR
16531657
snapshotID := vs.Annotations[common.VolumeSnapshotInfoKey]

0 commit comments

Comments
 (0)