Skip to content

Commit 1990033

Browse files
authored
Merge pull request #1610 from k8s-infra-cherrypick-robot/cherry-pick-1606-to-release-1.13
[release-1.13] Map UNSUPPORTED_OPERATION GCE operation error codes to InvalidArgument
2 parents a3c1127 + d1022f8 commit 1990033

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/gce-cloud-provider/compute/gce-compute.go

+1
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ func codeForGCEOpError(err computev1.OperationErrorErrors) codes.Code {
978978
"REGION_QUOTA_EXCEEDED": codes.ResourceExhausted,
979979
"RATE_LIMIT_EXCEEDED": codes.ResourceExhausted,
980980
"INVALID_USAGE": codes.InvalidArgument,
981+
"UNSUPPORTED_OPERATION": codes.InvalidArgument,
981982
}
982983
if code, ok := userErrors[err.Code]; ok {
983984
return code

pkg/gce-cloud-provider/compute/gce-compute_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func TestCodeForGCEOpError(t *testing.T) {
162162
{
163163
name: "UNSUPPORTED_OPERATION error",
164164
inputErr: computev1.OperationErrorErrors{Code: "UNSUPPORTED_OPERATION"},
165-
expCode: codes.Internal,
165+
expCode: codes.InvalidArgument,
166166
},
167167
}
168168

0 commit comments

Comments
 (0)