Skip to content

Automated cherry pick of #1406: Change Unavailable error codes that signal a problem with the #1408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/gce-cloud-provider/compute/gce-compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ func wrapOpErr(name string, opErr *computev1.OperationErrorErrors) error {
}

// codeForGCEOpError return the grpc error code for the passed in
// gce operation error.
// gce operation error. All of these error codes are filtered out from our SLO,
// but will be monitored by the stockout reporting dashboard.
func codeForGCEOpError(err computev1.OperationErrorErrors) codes.Code {
userErrors := map[string]codes.Code{
"RESOURCE_NOT_FOUND": codes.NotFound,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gce-pd-csi-driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ func (b *csiErrorBackoff) code(id csiErrorBackoffId) codes.Code {
// If we haven't recorded a code, return unavailable, which signals a problem with the driver
// (ie, next() wasn't called correctly).
klog.Errorf("using default code for %s", id)
return codes.Unavailable
return codes.Internal
}

func (b *csiErrorBackoff) next(id csiErrorBackoffId, code codes.Code) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/gce-pd-csi-driver/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type GCEIdentityServer struct {
// GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error)
func (gceIdentity *GCEIdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
if gceIdentity.Driver.name == "" {
return nil, status.Error(codes.Unavailable, "Driver name not configured")
return nil, status.Error(codes.Internal, "Driver name not configured")
}

return &csi.GetPluginInfoResponse{
Expand Down