mirror of https://github.com/docker/buildx.git
don't print build details when progress is rawjson
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
d0177c6da3
commit
598bc16e5d
|
@ -138,7 +138,7 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
|
|||
if err == nil {
|
||||
err = err1
|
||||
}
|
||||
if err == nil && progressMode != progressui.QuietMode {
|
||||
if err == nil && progressMode != progressui.QuietMode && progressMode != progressui.RawJSONMode {
|
||||
desktop.PrintBuildDetails(os.Stderr, printer.BuildRefs(), term)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -294,10 +294,13 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
|
|||
return retErr
|
||||
}
|
||||
|
||||
if progressMode != progressui.QuietMode {
|
||||
desktop.PrintBuildDetails(os.Stderr, printer.BuildRefs(), term)
|
||||
} else {
|
||||
switch progressMode {
|
||||
case progressui.RawJSONMode:
|
||||
// no additional display
|
||||
case progressui.QuietMode:
|
||||
fmt.Println(getImageID(resp.ExporterResponse))
|
||||
default:
|
||||
desktop.PrintBuildDetails(os.Stderr, printer.BuildRefs(), term)
|
||||
}
|
||||
if options.imageIDFile != "" {
|
||||
if err := os.WriteFile(options.imageIDFile, []byte(getImageID(resp.ExporterResponse)), 0644); err != nil {
|
||||
|
@ -753,7 +756,7 @@ func dockerUlimitToControllerUlimit(u *dockeropts.UlimitOpt) *controllerapi.Ulim
|
|||
}
|
||||
|
||||
func printWarnings(w io.Writer, warnings []client.VertexWarning, mode progressui.DisplayMode) {
|
||||
if len(warnings) == 0 || mode == progressui.QuietMode {
|
||||
if len(warnings) == 0 || mode == progressui.QuietMode || mode == progressui.RawJSONMode {
|
||||
return
|
||||
}
|
||||
fmt.Fprintf(w, "\n ")
|
||||
|
|
Loading…
Reference in New Issue