1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Windows: hacking around content addressable IDs for temporary fix.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
Stefan J. Wernli 2015-11-16 16:55:47 -08:00
parent ef424c108a
commit d860ff79a0

View file

@ -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)