mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
controller: replace logrus status messages with progress messages
logrus info messages aren't particularly in-theme with the rest of the progress output (and are also frustratingly racy). The progress output is a lot neater, so we refactor it into that. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -279,7 +279,7 @@ func runControllerBuild(ctx context.Context, dockerCli command.Cli, options buil
|
||||
return nil, errors.Errorf("Dockerfile or context from stdin is not supported with invoke")
|
||||
}
|
||||
|
||||
c, err := controller.NewController(ctx, options.ControlOptions, dockerCli)
|
||||
c, err := controller.NewController(ctx, options.ControlOptions, dockerCli, printer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -25,8 +25,13 @@ func debugShellCmd(dockerCli command.Cli) *cobra.Command {
|
||||
Use: "debug-shell",
|
||||
Short: "Start a monitor",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
printer, err := progress.NewPrinter(context.TODO(), os.Stderr, os.Stderr, progressMode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx := context.TODO()
|
||||
c, err := controller.NewController(ctx, options, dockerCli)
|
||||
c, err := controller.NewController(ctx, options, dockerCli, printer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -40,11 +45,6 @@ func debugShellCmd(dockerCli command.Cli) *cobra.Command {
|
||||
return errors.Errorf("failed to configure terminal: %v", err)
|
||||
}
|
||||
|
||||
printer, err := progress.NewPrinter(context.TODO(), os.Stderr, os.Stderr, progressMode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = monitor.RunMonitor(ctx, "", nil, controllerapi.InvokeConfig{
|
||||
Tty: true,
|
||||
}, c, os.Stdin, os.Stdout, os.Stderr, printer)
|
||||
|
Reference in New Issue
Block a user