[x] ... the documentation does not mention anything about my problem
[x] ... there are no open or closed issues that are related to my problem
Description
In our CI we setup buildx builder with 2 nodes - arm64 and amd64 to build multi-arch docker images. CI runs docker inspect --bootstrap to check that both of them are up and ready. When one node fails (because of a timeout) the inspect command ignores it, prints the summary and completes with exit code 0.
Expected behaviour
docker inspect --bootstrap should exit with non-zero exit-code when one of the nodes fails to start. When command fails it's possible to catch a non-zero status code and retry bootstraping the nodes.
Contributing guidelines
I've found a bug and checked that ...
Description
In our CI we setup buildx builder with 2 nodes - arm64 and amd64 to build multi-arch docker images. CI runs
docker inspect --bootstrap
to check that both of them are up and ready. When one node fails (because of a timeout) the inspect command ignores it, prints the summary and completes withexit code 0
.Expected behaviour
docker inspect --bootstrap
should exit with non-zero exit-code when one of the nodes fails to start. When command fails it's possible to catch a non-zero status code and retry bootstraping the nodes.Actual behaviour
When single node fails the
driver.Boot
returns an error which is stored in the channelerrCh
.printer.Wait()
never returns an error. Soerr
isnil
andlen(errCh) == 1
. So the lastreturn
statement is executed withtrue, nil
. For more details see my gist with minimal reproducible example. https://github.com/docker/buildx/blob/65c475647313b3edc502dcdd48b8ce4128b60dee/builder/builder.go#L178-L206printer.Wait()
: https://github.com/docker/buildx/blob/65c475647313b3edc502dcdd48b8ce4128b60dee/util/progress/printer.go#L39-L45pw.err
is assigned here https://github.com/docker/buildx/blob/65c475647313b3edc502dcdd48b8ce4128b60dee/util/progress/printer.go#L133but
UpdateFrom
never sets the error, except thectx.Done
case. https://github.com/docker/buildx/blob/171fcbeb69d67c90ba7f44f41a9e418f6a6ec1da/vendor/github.com/moby/buildkit/util/progress/progressui/display.go#L80-L80Buildx version
v0.14.0
Docker info
No response
Builders list
-
Configuration
Here is the link to this gist with code to reproduce bug in the
(b *Builder) Boot()
function: https://gist.github.com/moleus/6bf1ad37f47dd86ed12f4c4345601e22Build logs
Additional info
I suggest replacing
with
so
inspect
fails when one of the nodes fails to setup