Skip to content

Commit 9364bf9

Browse files
authored
Merge pull request #1880 from k8s-infra-cherrypick-robot/cherry-pick-1847-to-release-1.14
[release-1.14] Map RESOURCE_OPERATION_RATE_EXCEEDED to ResourceExhausted
2 parents de471a5 + 3af5e15 commit 9364bf9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,7 @@ func codeForGCEOpError(err computev1.OperationErrorErrors) codes.Code {
11371137
"RATE_LIMIT_EXCEEDED": codes.ResourceExhausted,
11381138
"INVALID_USAGE": codes.InvalidArgument,
11391139
"UNSUPPORTED_OPERATION": codes.InvalidArgument,
1140+
"RESOURCE_OPERATION_RATE_EXCEEDED": codes.ResourceExhausted,
11401141
}
11411142
if code, ok := userErrors[err.Code]; ok {
11421143
return code

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

+5
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ func TestCodeForGCEOpError(t *testing.T) {
164164
inputErr: computev1.OperationErrorErrors{Code: "UNSUPPORTED_OPERATION"},
165165
expCode: codes.InvalidArgument,
166166
},
167+
{
168+
name: "RESOURCE_OPERATION_RATE_EXCEEDED error",
169+
inputErr: computev1.OperationErrorErrors{Code: "RESOURCE_OPERATION_RATE_EXCEEDED"},
170+
expCode: codes.ResourceExhausted,
171+
},
167172
}
168173

169174
for _, tc := range testCases {

0 commit comments

Comments
 (0)