Skip to content

Commit

Permalink
[442] - fixing incorrect position of tarPath argument (#693)
Browse files Browse the repository at this point in the history
* [442] - fixing incorrect position of tarPath argument

* Final verdict is p needs to absolute, tarPath needs to be relative and everything is peachy
  • Loading branch information
dcherniv authored and dlorenc committed Jun 18, 2018
1 parent be0c286 commit 86c7179
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion pkg/skaffold/docker/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestDockerContext(t *testing.T) {
ioutil.WriteFile(filepath.Join(tmpDir, "Dockerfile"), []byte("FROM alpine\nCOPY ./files /files"), 0644)
ioutil.WriteFile(filepath.Join(tmpDir, "ignored.txt"), []byte(""), 0644)
ioutil.WriteFile(filepath.Join(tmpDir, "alsoignored.txt"), []byte(""), 0644)

reader, writer := io.Pipe()
go func() {
err := CreateDockerTarContext(writer, "Dockerfile", tmpDir)
Expand Down
6 changes: 3 additions & 3 deletions pkg/skaffold/util/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func CreateTar(w io.Writer, root string, paths []string) error {
defer tw.Close()

for _, p := range paths {
tarPath := filepath.ToSlash(filepath.Join(root, p))

if err := addFileToTar(tarPath, p, tw); err != nil {
tarPath := filepath.ToSlash(p)
p := filepath.Join(root, p)
if err := addFileToTar(p, tarPath, tw); err != nil {
return err
}

Expand Down

0 comments on commit 86c7179

Please sign in to comment.