mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-31 15:48:04 +08:00
build: fix build details link in experimental mode
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/docker/buildx/commands"
|
||||
controllererrors "github.com/docker/buildx/controller/errdefs"
|
||||
"github.com/docker/buildx/util/desktop"
|
||||
"github.com/docker/buildx/version"
|
||||
"github.com/docker/cli/cli"
|
||||
@@ -16,6 +17,7 @@ import (
|
||||
cliflags "github.com/docker/cli/cli/flags"
|
||||
"github.com/moby/buildkit/solver/errdefs"
|
||||
"github.com/moby/buildkit/util/stack"
|
||||
"github.com/pkg/errors"
|
||||
"go.opentelemetry.io/otel"
|
||||
|
||||
//nolint:staticcheck // vendored dependencies may still use this
|
||||
@@ -109,8 +111,15 @@ func main() {
|
||||
} else {
|
||||
fmt.Fprintf(cmd.Err(), "ERROR: %v\n", err)
|
||||
}
|
||||
if ebr, ok := err.(*desktop.ErrorWithBuildRef); ok {
|
||||
|
||||
var ebr *desktop.ErrorWithBuildRef
|
||||
if errors.As(err, &ebr) {
|
||||
ebr.Print(cmd.Err())
|
||||
} else {
|
||||
var be *controllererrors.BuildError
|
||||
if errors.As(err, &be) {
|
||||
be.PrintBuildDetails(cmd.Err())
|
||||
}
|
||||
}
|
||||
|
||||
os.Exit(1)
|
||||
|
Reference in New Issue
Block a user