Skip to content

Commit d1022f8

Browse files
amacaskillk8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
Map UNSUPPORTED_OPERATION GCE operation error codes to Invalid Argument
1 parent a3c1127 commit d1022f8

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)