Browse code

Windows: Filepath in graph\load.go

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/05/05 07:14:39
Showing 1 changed files
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"io"
8 8
 	"io/ioutil"
9 9
 	"os"
10
-	"path"
10
+	"path/filepath"
11 11
 
12 12
 	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/image"
... ...
@@ -25,7 +25,7 @@ func (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {
25 25
 	defer os.RemoveAll(tmpImageDir)
26 26
 
27 27
 	var (
28
-		repoDir = path.Join(tmpImageDir, "repo")
28
+		repoDir = filepath.Join(tmpImageDir, "repo")
29 29
 	)
30 30
 
31 31
 	if err := os.Mkdir(repoDir, os.ModeDir); err != nil {
... ...
@@ -58,7 +58,7 @@ func (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {
58 58
 		}
59 59
 	}
60 60
 
61
-	reposJSONFile, err := os.Open(path.Join(tmpImageDir, "repo", "repositories"))
61
+	reposJSONFile, err := os.Open(filepath.Join(tmpImageDir, "repo", "repositories"))
62 62
 	if err != nil {
63 63
 		if !os.IsNotExist(err) {
64 64
 			return err
... ...
@@ -87,13 +87,13 @@ func (s *TagStore) recursiveLoad(address, tmpImageDir string) error {
87 87
 	if _, err := s.LookupImage(address); err != nil {
88 88
 		logrus.Debugf("Loading %s", address)
89 89
 
90
-		imageJson, err := ioutil.ReadFile(path.Join(tmpImageDir, "repo", address, "json"))
90
+		imageJson, err := ioutil.ReadFile(filepath.Join(tmpImageDir, "repo", address, "json"))
91 91
 		if err != nil {
92 92
 			logrus.Debugf("Error reading json", err)
93 93
 			return err
94 94
 		}
95 95
 
96
-		layer, err := os.Open(path.Join(tmpImageDir, "repo", address, "layer.tar"))
96
+		layer, err := os.Open(filepath.Join(tmpImageDir, "repo", address, "layer.tar"))
97 97
 		if err != nil {
98 98
 			logrus.Debugf("Error reading embedded tar", err)
99 99
 			return err