Skip to content
Open
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
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ linters:
- unusedwrite
importas:
alias:
- pkg: errors
alias: stderrors
- pkg: github.com/containerd/errdefs
alias: cerrdefs
- pkg: github.com/opencontainers/image-spec/specs-go/v1
Expand Down
4 changes: 3 additions & 1 deletion util/tracing/otlptracegrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package otlptracegrpc

import (
"context"
stderrors "errors"
"sync"
"time"

Expand Down Expand Up @@ -80,7 +81,8 @@ func (c *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
c.lock.Lock()
defer c.lock.Unlock()
if c.tracesClient == nil {
return errNoClient
// Intentionally using a stdlib error here; see https://github.com/moby/buildkit/commit/f57b3ef89b3053048e7f46d0296d98bcef79448b
return stderrors.New("no client")
Comment on lines -83 to +85
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @tonistiigi in case it was not required to use stdlib errors for this; if so, we can drop the extra import and just use errors.New() from pkg/errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just leave pkg/errors to get stacktrace.

}

_, err := c.tracesClient.Export(ctx, &coltracepb.ExportTraceServiceRequest{
Expand Down
7 changes: 0 additions & 7 deletions util/tracing/otlptracegrpc/errors.go

This file was deleted.

Loading