mirror of
https://github.com/docker/compose.git
synced 2026-09-27 18:00:08 +00:00
test: detect containerd image store directly in multi-arch error test
The 'builder does not support multi-arch' subtest expects the docker driver to reject multi-platform builds, and skipped itself by checking that buildx lists both linux/amd64 and linux/arm64. That heuristic misses containerd-store hosts without binfmt emulation (plain CI runners): only native platforms are listed even though the driver happily cross-builds, so the build succeeds and the test fails with 'ExitCode was 0 expected 1'. Skip on the containerd image store directly, detected from the daemon's DriverStatus. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
c936d76faa
commit
bbcd8108b2
1 changed files with 9 additions and 0 deletions
|
|
@ -410,6 +410,15 @@ func TestBuildPlatformsStandardErrors(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("builder does not support multi-arch", func(t *testing.T) {
|
||||
// The docker driver supports multi-platform builds whenever the
|
||||
// daemon uses the containerd image store, so this error won't occur.
|
||||
// Detect the store directly: the buildx `Platforms:` heuristic below
|
||||
// misses it on hosts without binfmt emulation, where only native
|
||||
// platforms are listed even though cross-building works.
|
||||
info := c.RunDockerCmd(t, "info", "-f", "{{json .DriverStatus}}")
|
||||
if strings.Contains(info.Stdout(), "io.containerd.snapshotter.v1") {
|
||||
t.Skip("docker driver supports multi-platform builds (containerd image store enabled)")
|
||||
}
|
||||
// Docker Desktop with containerd image store uses the docker driver
|
||||
// but supports multi-platform builds, so this error won't occur.
|
||||
inspect := c.RunDockerCmd(t, "buildx", "inspect", "--bootstrap")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue