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>
pull/1206/head
Justin Chadwell 3 years ago
parent 5b452b72a2
commit 309c49413c

@ -242,6 +242,11 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
if err = loadNodeGroupData(timeoutCtx, dockerCli, ngi); err != nil { if err = loadNodeGroupData(timeoutCtx, dockerCli, ngi); err != nil {
return err 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 in.bootstrap {
if _, err = boot(ctx, ngi); err != nil { if _, err = boot(ctx, ngi); err != nil {

Loading…
Cancel
Save