Skip to content

Commit 8f2a701

Browse files
halimsamcemakd
authored andcommitted
Return error for any Data Cache related code in NodeStageVolume &
NodeUnstageVolume.
1 parent 040ec58 commit 8f2a701

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
338338
}
339339
devicePath, err = setupCaching(devFsPath, req, nodeId)
340340
if err != nil {
341-
return nil, status.Error(codes.Internal, fmt.Sprintf("Error setting up cache: %v", err.Error()))
341+
return nil, status.Error(codes.DataLoss, fmt.Sprintf("Error setting up cache: %v", err.Error()))
342342
}
343343
}
344344

@@ -494,7 +494,7 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns
494494
nodeId := ns.MetadataService.GetName()
495495
err := cleanupCache(volumeID, nodeId)
496496
if err != nil {
497-
klog.Errorf("Failed to cleanup cache for volume %s: %v", volumeID, err)
497+
return nil, status.Errorf(codes.DataLoss, "Failed to cleanup cache for volume %s: %v", volumeID, err)
498498
}
499499
}
500500
klog.V(4).Infof("NodeUnstageVolume succeeded on %v from %s", volumeID, stagingTargetPath)

0 commit comments

Comments
 (0)