Addressing review comments
This commit is contained in:
parent
dbabcb1f5f
commit
4e1639c030
|
|
@ -30,17 +30,17 @@ import (
|
||||||
|
|
||||||
var copyTests = []struct {
|
var copyTests = []struct {
|
||||||
name string
|
name string
|
||||||
SourcesAndDest []string
|
sourcesAndDest []string
|
||||||
expectedDest []string
|
expectedDest []string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "copy foo into tempCopyExecuteTest/",
|
name: "copy foo into tempCopyExecuteTest/",
|
||||||
SourcesAndDest: []string{"foo", "tempCopyExecuteTest/"},
|
sourcesAndDest: []string{"foo", "tempCopyExecuteTest/"},
|
||||||
expectedDest: []string{"foo"},
|
expectedDest: []string{"foo"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "copy foo into tempCopyExecuteTest",
|
name: "copy foo into tempCopyExecuteTest",
|
||||||
SourcesAndDest: []string{"foo", "tempCopyExecuteTest"},
|
sourcesAndDest: []string{"foo", "tempCopyExecuteTest"},
|
||||||
expectedDest: []string{"tempCopyExecuteTest"},
|
expectedDest: []string{"tempCopyExecuteTest"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -60,13 +60,13 @@ func TestCopyExecuteCmd(t *testing.T) {
|
||||||
|
|
||||||
cmd := CopyCommand{
|
cmd := CopyCommand{
|
||||||
cmd: &instructions.CopyCommand{
|
cmd: &instructions.CopyCommand{
|
||||||
SourcesAndDest: test.SourcesAndDest,
|
SourcesAndDest: test.sourcesAndDest,
|
||||||
},
|
},
|
||||||
buildcontext: "../../integration/context/",
|
buildcontext: "../../integration/context/",
|
||||||
}
|
}
|
||||||
|
|
||||||
buildArgs := copySetUpBuildArgs()
|
buildArgs := copySetUpBuildArgs()
|
||||||
dest := cfg.WorkingDir + test.SourcesAndDest[len(test.SourcesAndDest)-1]
|
dest := cfg.WorkingDir + test.sourcesAndDest[len(test.sourcesAndDest)-1]
|
||||||
|
|
||||||
os.RemoveAll(dest)
|
os.RemoveAll(dest)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,6 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error {
|
||||||
fi, err := os.Stat(dir)
|
fi, err := os.Stat(dir)
|
||||||
if os.IsNotExist(err) || !fi.IsDir() {
|
if os.IsNotExist(err) || !fi.IsDir() {
|
||||||
logrus.Infof("base %s for file %s does not exist. Creating.", base, path)
|
logrus.Infof("base %s for file %s does not exist. Creating.", base, path)
|
||||||
//os.RemoveAll(dir)
|
|
||||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue