Skip to content

Commit 629ddec

Browse files
authored
Merge pull request #1710 from amacaskill/operation-error-code-internal
Reassign error returned from validateStoragePools so InvalidArgument is recorded
2 parents 586f6c8 + 8aec1f5 commit 629ddec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
326326

327327
err = validateStoragePools(req, params, gceCS.CloudProvider.GetDefaultProject())
328328
if err != nil {
329-
return nil, status.Errorf(codes.InvalidArgument, "CreateVolume failed to validate storage pools: %v", err)
329+
// Reassign error so that all errors are reported as InvalidArgument to RecordOperationErrorMetrics.
330+
err = status.Errorf(codes.InvalidArgument, "CreateVolume failed to validate storage pools: %v", err)
331+
return nil, err
330332
}
331333

332334
// Verify that the regional availability class is only used on regional disks.

0 commit comments

Comments
 (0)