Skip to content

Commit 9675b36

Browse files
authored
Merge pull request #1721 from k8s-infra-cherrypick-robot/cherry-pick-1710-to-release-1.13
[release-1.13] Reassign error returned from validateStoragePools so InvalidArgument is recorded
2 parents dd65e7c + e274620 commit 9675b36

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
@@ -290,7 +290,9 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
290290

291291
err = validateStoragePools(req, params, gceCS.CloudProvider.GetDefaultProject())
292292
if err != nil {
293-
return nil, status.Errorf(codes.InvalidArgument, "CreateVolume failed to validate storage pools: %v", err)
293+
// Reassign error so that all errors are reported as InvalidArgument to RecordOperationErrorMetrics.
294+
err = status.Errorf(codes.InvalidArgument, "CreateVolume failed to validate storage pools: %v", err)
295+
return nil, err
294296
}
295297

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

0 commit comments

Comments
 (0)