docker inspect --bootstrap
ignores an error and exits successfully when one of two nodes fails
#2730
Open
3 tasks done
Labels
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.buildx/builder/builder.go
Lines 178 to 206 in 65c4756
printer.Wait()
:buildx/util/progress/printer.go
Lines 39 to 45 in 65c4756
pw.err
is assigned herebuildx/util/progress/printer.go
Line 133 in 65c4756
but
UpdateFrom
never sets the error, except thectx.Done
case.buildx/vendor/github.com/moby/buildkit/util/progress/progressui/display.go
Line 80 in 171fcbe
Buildx 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/6bf1ad37f47dd86ed12f4c4345601e22
Build logs
Additional info
I suggest replacing
with
so
inspect
fails when one of the nodes fails to setupThe text was updated successfully, but these errors were encountered: