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 <me@jedevc.com>
This commit is contained in:
Justin Chadwell 2022-07-12 13:10:05 +01:00
parent 5b452b72a2
commit 309c49413c
1 changed files with 5 additions and 0 deletions

View File

@ -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 {