From 309c49413cec5576d0cb4b45aefff0a371eb1e79 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Tue, 12 Jul 2022 13:10:05 +0100 Subject: [PATCH] buildx: log errors in initializing builders Previously, errors within the driver config would not be reported to the user until they tried to use the driver, even though they are easily accessible from the node group info. This patch reports these errors (but will not fail because of them, since the data is already saved) - this should help improve debuggability of some of the more complex drivers, and prevent error messages being suppressed. Signed-off-by: Justin Chadwell --- commands/create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/create.go b/commands/create.go index 2a9c1296..9238551c 100644 --- a/commands/create.go +++ b/commands/create.go @@ -242,6 +242,11 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error { if err = loadNodeGroupData(timeoutCtx, dockerCli, ngi); err != nil { return err } + for _, info := range ngi.drivers { + if err := info.di.Err; err != nil { + logrus.Errorf("failed to initialize builder %s (%s): %s", ng.Name, info.di.Name, err) + } + } if in.bootstrap { if _, err = boot(ctx, ngi); err != nil {