From d860ff79a0df4f406578b0a206769f4239072d86 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Mon, 16 Nov 2015 16:55:47 -0800 Subject: [PATCH] Windows: hacking around content addressable IDs for temporary fix. Signed-off-by: Stefan J. Wernli --- graph/pull_v2.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/graph/pull_v2.go b/graph/pull_v2.go index 76e20bb5df..4ccc6c7196 100644 --- a/graph/pull_v2.go +++ b/graph/pull_v2.go @@ -7,6 +7,7 @@ import ( "io" "io/ioutil" "os" + "runtime" "github.com/Sirupsen/logrus" "github.com/docker/distribution" @@ -601,6 +602,15 @@ func (p *v2Puller) attemptIDReuse(imgs []contentAddressableDescriptor) { continueReuse := true for i := len(imgs) - 1; i >= 0; i-- { + // TODO - (swernli:11-16-2015) Skipping content addressable IDs on + // Windows as a hack for TP4 compat. The correct fix is to ensure that + // Windows layers do not have anything in them that takes a dependency + // on the ID of the layer in the management client. This will be fixed + // in Windows post-TP4. + if runtime.GOOS == "windows" { + imgs[i].id = imgs[i].compatibilityID + } + if p.graph.Exists(imgs[i].id) { // Found an image in the graph under the strongID. Validate the // image before using it. @@ -658,6 +668,14 @@ func (p *v2Puller) validateImageInGraph(id string, imgs []contentAddressableDesc if err != nil { return fmt.Errorf("missing: %v", err) } + if runtime.GOOS == "windows" { + // TODO - (swernli:11-16-2015) Skipping content addressable IDs on + // Windows as a hack for TP4 compat. The correct fix is to ensure that + // Windows layers do not have anything in them that takes a dependency + // on the ID of the layer in the management client. This will be fixed + // in Windows post-TP4. + return nil + } layerID, err := p.graph.getLayerDigest(id) if err != nil { return fmt.Errorf("digest: %v", err)