mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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>
This commit is contained in:
parent
b8265e5550
commit
6b7d028085
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/distribution"
|
"github.com/docker/distribution"
|
||||||
"github.com/docker/distribution/context"
|
"github.com/docker/distribution/context"
|
||||||
"github.com/docker/distribution/manifest/schema2"
|
"github.com/docker/distribution/manifest/schema2"
|
||||||
|
@ -34,11 +35,13 @@ func (ld *v2LayerDescriptor) open(ctx context.Context) (distribution.ReadSeekClo
|
||||||
|
|
||||||
// Find the first URL that results in a 200 result code.
|
// Find the first URL that results in a 200 result code.
|
||||||
for _, url := range ld.src.URLs {
|
for _, url := range ld.src.URLs {
|
||||||
|
logrus.Debugf("Pulling %v from foreign URL %v", ld.digest, url)
|
||||||
rsc = transport.NewHTTPReadSeeker(http.DefaultClient, url, nil)
|
rsc = transport.NewHTTPReadSeeker(http.DefaultClient, url, nil)
|
||||||
_, err = rsc.Seek(0, os.SEEK_SET)
|
_, err = rsc.Seek(0, os.SEEK_SET)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
logrus.Debugf("Download for %v failed: %v", ld.digest, err)
|
||||||
rsc.Close()
|
rsc.Close()
|
||||||
rsc = nil
|
rsc = nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue