Skip to content

Commit ac01e47

Browse files
committed
Return error for any Data Cache related code in NodeStageVolume &
NodeUnstageVolume.
1 parent 6bb2719 commit ac01e47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/gce-pd-csi-driver/node.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
347347
}
348348
devicePath, err = setupCaching(devFsPath, req, nodeId)
349349
if err != nil {
350-
return nil, status.Error(codes.Internal, fmt.Sprintf("Error setting up cache: %v", err.Error()))
350+
return nil, status.Error(codes.DataLoss, fmt.Sprintf("Error setting up cache: %v", err.Error()))
351351
}
352352
}
353353

@@ -509,7 +509,7 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns
509509
nodeId := ns.MetadataService.GetName()
510510
err := cleanupCache(volumeID, nodeId)
511511
if err != nil {
512-
klog.Errorf("Failed to cleanup cache for volume %s: %v", volumeID, err)
512+
return nil, status.Errorf(codes.DataLoss, "Failed to cleanup cache for volume %s: %v", volumeID, err)
513513
}
514514
}
515515
klog.V(4).Infof("NodeUnstageVolume succeeded on %v from %s", volumeID, stagingTargetPath)

0 commit comments

Comments
 (0)