@@ -226,14 +226,17 @@ func (gceCS *GCEControllerServer) DeleteVolume(ctx context.Context, req *csi.Del
226
226
if err != nil {
227
227
// Cannot find volume associated with this ID because VolumeID is not in
228
228
// correct format, this is a success according to the Spec
229
- klog .Warningf ("Treating volume as deleted because volume id %s is invalid: %v" , volumeID , err )
229
+ klog .Warningf ("DeleteVolume treating volume as deleted because volume id %s is invalid: %v" , volumeID , err )
230
230
return & csi.DeleteVolumeResponse {}, nil
231
231
}
232
232
233
233
volKey , err = gceCS .CloudProvider .RepairUnderspecifiedVolumeKey (ctx , volKey )
234
234
if err != nil {
235
- klog .Warningf ("Treating volume as deleted because cannot find volume %v: %v" , volumeID , err )
236
- return & csi.DeleteVolumeResponse {}, nil
235
+ if gce .IsGCENotFoundError (err ) {
236
+ klog .Warningf ("DeleteVolume treating volume as deleted because cannot find volume %v: %v" , volumeID , err )
237
+ return & csi.DeleteVolumeResponse {}, nil
238
+ }
239
+ return nil , status .Errorf (codes .Internal , "DeleteVolume error repairing underspecified volume key: %v" , err )
237
240
}
238
241
239
242
if acquired := gceCS .volumeLocks .TryAcquire (volumeID ); ! acquired {
@@ -274,7 +277,10 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r
274
277
275
278
volKey , err = gceCS .CloudProvider .RepairUnderspecifiedVolumeKey (ctx , volKey )
276
279
if err != nil {
277
- return nil , status .Error (codes .NotFound , fmt .Sprintf ("Could not find volume with ID %v: %v" , volumeID , err ))
280
+ if gce .IsGCENotFoundError (err ) {
281
+ return nil , status .Errorf (codes .NotFound , "ControllerPublishVolume could not find volume with ID %v: %v" , volumeID , err )
282
+ }
283
+ return nil , status .Errorf (codes .Internal , "ControllerPublishVolume error repairing underspecified volume key: %v" , err )
278
284
}
279
285
280
286
// Acquires the lock for the volume on that node only, because we need to support the ability
0 commit comments