From 2578773887f7bae772ff84fc565ac139f406f072 Mon Sep 17 00:00:00 2001 From: Nishant Totla Date: Fri, 7 Jul 2017 15:10:15 -0700 Subject: [PATCH] Clear Architecture field in platform constraint for arm architectures Signed-off-by: Nishant Totla Upstream-commit: 772af6040ed4f2f26c22901597333a900be17aae Component: engine --- components/engine/client/service_create.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/engine/client/service_create.go b/components/engine/client/service_create.go index 6b9364d6f2..1b707d721a 100644 --- a/components/engine/client/service_create.go +++ b/components/engine/client/service_create.go @@ -3,6 +3,7 @@ package client import ( "encoding/json" "fmt" + "strings" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" @@ -98,6 +99,16 @@ func imageDigestAndPlatforms(ctx context.Context, cli DistributionAPIClient, ima if len(distributionInspect.Platforms) > 0 { platforms = make([]swarm.Platform, 0, len(distributionInspect.Platforms)) for _, p := range distributionInspect.Platforms { + // clear architecture field for arm. This is a temporary patch to address + // https://github.com/docker/swarmkit/issues/2294. The issue is that while + // image manifests report "arm" as the architecture, the node reports + // something like "armv7l" (includes the variant), which causes arm images + // to stop working with swarm mode. This patch removes the architecture + // constraint for arm images to ensure tasks get scheduled. + arch := strings.ToLower(p.Architecture) + if arch == "arm" { + arch = "" + } platforms = append(platforms, swarm.Platform{ Architecture: p.Architecture, OS: p.OS,