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