mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #12977 from Microsoft/10662-graphloadfilepath
Windows: Filepath in graph\load.go
This commit is contained in:
commit
7d38d33f01
1 changed files with 5 additions and 5 deletions
|
@ -7,7 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/docker/image"
|
"github.com/docker/docker/image"
|
||||||
|
@ -25,7 +25,7 @@ func (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {
|
||||||
defer os.RemoveAll(tmpImageDir)
|
defer os.RemoveAll(tmpImageDir)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
repoDir = path.Join(tmpImageDir, "repo")
|
repoDir = filepath.Join(tmpImageDir, "repo")
|
||||||
)
|
)
|
||||||
|
|
||||||
if err := os.Mkdir(repoDir, os.ModeDir); err != nil {
|
if err := os.Mkdir(repoDir, os.ModeDir); err != nil {
|
||||||
|
@ -58,7 +58,7 @@ func (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reposJSONFile, err := os.Open(path.Join(tmpImageDir, "repo", "repositories"))
|
reposJSONFile, err := os.Open(filepath.Join(tmpImageDir, "repo", "repositories"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
return err
|
return err
|
||||||
|
@ -87,13 +87,13 @@ func (s *TagStore) recursiveLoad(address, tmpImageDir string) error {
|
||||||
if _, err := s.LookupImage(address); err != nil {
|
if _, err := s.LookupImage(address); err != nil {
|
||||||
logrus.Debugf("Loading %s", address)
|
logrus.Debugf("Loading %s", address)
|
||||||
|
|
||||||
imageJson, err := ioutil.ReadFile(path.Join(tmpImageDir, "repo", address, "json"))
|
imageJson, err := ioutil.ReadFile(filepath.Join(tmpImageDir, "repo", address, "json"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Debugf("Error reading json", err)
|
logrus.Debugf("Error reading json", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
layer, err := os.Open(path.Join(tmpImageDir, "repo", address, "layer.tar"))
|
layer, err := os.Open(filepath.Join(tmpImageDir, "repo", address, "layer.tar"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Debugf("Error reading embedded tar", err)
|
logrus.Debugf("Error reading embedded tar", err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Reference in a new issue