From 27020f23b92ae0bed0c62e33cdc5eaa0351dd1cf Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Oct 2019 12:19:20 -0700 Subject: [PATCH] Resolving comments --- pkg/commands/copy_test.go | 7 +++---- pkg/util/fs_util.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/commands/copy_test.go b/pkg/commands/copy_test.go index fcdbf517f..9b16e9291 100644 --- a/pkg/commands/copy_test.go +++ b/pkg/commands/copy_test.go @@ -52,8 +52,7 @@ func setupTestTemp() string { if err != nil { logrus.Fatalf("error creating temp dir %s", err) } - //defer os.RemoveAll(tempDir) - logrus.Infof("Tempdir: %s", tempDir) + logrus.Debugf("Tempdir: %s", tempDir) srcPath, err := filepath.Abs("../../integration/context") if err != nil { @@ -101,6 +100,7 @@ func setupTestTemp() string { } func TestCopyExecuteCmd(t *testing.T) { tempDir := setupTestTemp() + defer os.RemoveAll(tempDir) cfg := &v1.Config{ Cmd: nil, @@ -121,7 +121,6 @@ func TestCopyExecuteCmd(t *testing.T) { buildArgs := copySetUpBuildArgs() dest := cfg.WorkingDir + "/" + test.sourcesAndDest[len(test.sourcesAndDest)-1] - logrus.Infof("dest dir: %s", dest) err := cmd.ExecuteCommand(cfg, buildArgs) if err != nil { @@ -143,7 +142,7 @@ func TestCopyExecuteCmd(t *testing.T) { t.Error() } for _, file := range files { - logrus.Infof("file: %v", file.Name()) + logrus.Debugf("file: %v", file.Name()) dirList = append(dirList, file.Name()) } } else { diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go index aa4289315..7a7f15b34 100644 --- a/pkg/util/fs_util.go +++ b/pkg/util/fs_util.go @@ -192,7 +192,7 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error { // or a file was copied over a directory prior to now fi, err := os.Stat(dir) if os.IsNotExist(err) || !fi.IsDir() { - logrus.Infof("base %s for file %s does not exist. Creating.", base, path) + logrus.Debugf("base %s for file %s does not exist. Creating.", base, path) if err := os.MkdirAll(dir, 0755); err != nil { return err }