Skip to content

Commit

Permalink
Fixes for new printer APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
  • Loading branch information
ktock committed Oct 18, 2023
1 parent 1a4b2c6 commit 335acca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func runControllerBuild(ctx context.Context, dockerCli command.Cli, opts *contro
return nil
})

if options.invoke != nil && options.invoke.invokeFlag == "debug-step" {
if options.invokeConfig != nil && options.invokeConfig.invokeFlag == "debug-step" {
// Special mode where we don't get the result but get only the build definition.
// In this mode, Build() doesn't perform the build therefore always fails.
opts.Debug = true
Expand Down
3 changes: 2 additions & 1 deletion monitor/dap/dap.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/moby/buildkit/identity"
"github.com/moby/buildkit/solver/errdefs"
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/progress/progressui"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
Expand Down Expand Up @@ -375,7 +376,7 @@ func (s *Server) launchDebugger(cfg LaunchConfig) (retErr error) {
}
}()
var printer *progress.Printer
printer, err = progress.NewPrinter(ctx, s.outputStdoutWriter(), nil, "plain",
printer, err = progress.NewPrinter(ctx, s.outputStdoutWriter(), progressui.PlainMode,
progress.WithOnClose(func() {
printWarnings(s.outputStdoutWriter(), printer.Warnings())
}),
Expand Down
4 changes: 2 additions & 2 deletions util/progress/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package progress

import (
"context"
"io"
"os"
"sync"

"github.com/containerd/console"
"github.com/docker/buildx/util/logutil"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/util/progress/progressui"
Expand Down Expand Up @@ -80,7 +80,7 @@ func (p *Printer) ClearLogSource(v interface{}) {
}
}

func NewPrinter(ctx context.Context, out console.File, mode progressui.DisplayMode, opts ...PrinterOpt) (*Printer, error) {
func NewPrinter(ctx context.Context, out io.Writer, mode progressui.DisplayMode, opts ...PrinterOpt) (*Printer, error) {
opt := &printerOpts{}
for _, o := range opts {
o(opt)
Expand Down

0 comments on commit 335acca

Please sign in to comment.