Browse code

Windows: Add debug output to foreign layer pull

Write the foreign layer URLs being downloaded into the debug log.

Signed-off-by: John Starks <jostarks@microsoft.com>

John Starks authored on 2016/09/27 00:47:38
Showing 1 changed files
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"net/http"
7 7
 	"os"
8 8
 
9
+	"github.com/Sirupsen/logrus"
9 10
 	"github.com/docker/distribution"
10 11
 	"github.com/docker/distribution/context"
11 12
 	"github.com/docker/distribution/manifest/schema2"
... ...
@@ -34,11 +35,13 @@ func (ld *v2LayerDescriptor) open(ctx context.Context) (distribution.ReadSeekClo
34 34
 
35 35
 	// Find the first URL that results in a 200 result code.
36 36
 	for _, url := range ld.src.URLs {
37
+		logrus.Debugf("Pulling %v from foreign URL %v", ld.digest, url)
37 38
 		rsc = transport.NewHTTPReadSeeker(http.DefaultClient, url, nil)
38 39
 		_, err = rsc.Seek(0, os.SEEK_SET)
39 40
 		if err == nil {
40 41
 			break
41 42
 		}
43
+		logrus.Debugf("Download for %v failed: %v", ld.digest, err)
42 44
 		rsc.Close()
43 45
 		rsc = nil
44 46
 	}