From 6b6afc4077badf4a97b01e6d323ac41ad9a0db80 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 7 Dec 2020 23:43:28 -0800 Subject: [PATCH] build: add logger for auth Signed-off-by: Tonis Tiigi --- build/build.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/build.go b/build/build.go index 7f0256fbd4b..8e548b2660d 100644 --- a/build/build.go +++ b/build/build.go @@ -26,6 +26,7 @@ import ( "github.com/moby/buildkit/session" "github.com/moby/buildkit/session/upload/uploadprovider" "github.com/moby/buildkit/util/entitlements" + "github.com/moby/buildkit/util/progress/progresswriter" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -527,6 +528,15 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do defers = append(defers, release) m[k][i].so = so } + for _, at := range opt.Session { + if s, ok := at.(interface { + SetLogger(progresswriter.Logger) + }); ok { + s.SetLogger(func(s *client.SolveStatus) { + w.Write(s) + }) + } + } } resp = map[string]*client.SolveResponse{}