Skip to content

Commit e86577f

Browse files
committed
Set error code to indicate timeout in pvCSI
1 parent 52ccaa1 commit e86577f

File tree

2 files changed

+441
-1
lines changed

2 files changed

+441
-1
lines changed

pkg/csi/service/wcpguest/controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ func (c *controller) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequ
469469

470470
log.Errorf("Last observed events on the pvc %q/%q in supervisor cluster: %+v",
471471
c.supervisorNamespace, pvc.Name, spew.Sdump(eventList.Items))
472-
return nil, csifault.CSIInternalFault, status.Error(codes.Internal, msg)
472+
// Note: Set the return code to codes.DeadlineExceeded if PVC is still not bound
473+
// to indicate that the volume provisioning has timed out
474+
// so that external-provisioner will keep retrying and won't leave
475+
// orphan volumes behind.
476+
return nil, csifault.CSIInternalFault, status.Error(codes.DeadlineExceeded, msg)
473477
}
474478
attributes := make(map[string]string)
475479
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.FileVolume) && isFileVolumeRequest {

0 commit comments

Comments
 (0)