@@ -162,7 +162,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
162162
163163 snap , err := cloud .GetSnapshotByID (ctx , sourceSnapshotID )
164164 if stackiterrors .IgnoreNotFound (err ) != nil {
165- return nil , status .Errorf (codes .NotFound , "Failed to retrieve the source snapshot %s: %v" , sourceSnapshotID , err )
165+ return nil , status .Errorf (codes .Internal , "Failed to retrieve the source snapshot %s: %v" , sourceSnapshotID , err )
166166 }
167167 // If the snapshot exists but is not yet available, fail.
168168 if err == nil && * snap .Status != stackit .SnapshotReadyStatus {
@@ -206,7 +206,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
206206 if stackiterrors .IsNotFound (err ) {
207207 return nil , status .Errorf (codes .NotFound , "Source Volume %s not found" , sourceVolID )
208208 }
209- return nil , status .Errorf (codes .NotFound , "Failed to retrieve the source volume %s: %v" , sourceVolID , err )
209+ return nil , status .Errorf (codes .Internal , "Failed to retrieve the source volume %s: %v" , sourceVolID , err )
210210 }
211211 if volAvailability != * sourceVolume .AvailabilityZone {
212212 return nil , status .Errorf (codes .ResourceExhausted , "Volume must be in the same availability zone as source Volume. Got %s Required: %s" , volAvailability , * sourceVolume .AvailabilityZone )
@@ -357,15 +357,15 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
357357 if stackiterrors .IsNotFound (err ) {
358358 return nil , status .Errorf (codes .NotFound , "[ControllerPublishVolume] Volume %s not found" , volumeID )
359359 }
360- return nil , status .Errorf (codes .NotFound , "[ControllerPublishVolume] get volume failed with error %v" , err )
360+ return nil , status .Errorf (codes .Internal , "[ControllerPublishVolume] get volume failed with error %v" , err )
361361 }
362362
363363 _ , err = cloud .GetInstanceByID (ctx , instanceID )
364364 if err != nil {
365365 if stackiterrors .IsNotFound (err ) {
366366 return nil , status .Errorf (codes .NotFound , "[ControllerPublishVolume] Instance %s not found" , instanceID )
367367 }
368- return nil , status .Errorf (codes .NotFound , "[ControllerPublishVolume] GetInstanceByID failed with error %v" , err )
368+ return nil , status .Errorf (codes .Internal , "[ControllerPublishVolume] GetInstanceByID failed with error %v" , err )
369369 }
370370
371371 _ , err = cloud .AttachVolume (ctx , instanceID , volumeID )
@@ -840,7 +840,7 @@ func (cs *controllerServer) ValidateVolumeCapabilities(ctx context.Context, req
840840 if stackiterrors .IsNotFound (err ) {
841841 return nil , status .Errorf (codes .NotFound , "ValidateVolumeCapabilities Volume %s not found" , volumeID )
842842 }
843- return nil , status .Errorf (codes .NotFound , "ValidateVolumeCapabilities %v" , err )
843+ return nil , status .Errorf (codes .Internal , "ValidateVolumeCapabilities %v" , err )
844844 }
845845
846846 for _ , volCap := range reqVolCap {
0 commit comments