From 2d73c2d996efd8b116418cc24e76a98ac228e45d Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Mon, 7 Oct 2019 13:06:40 -0700 Subject: [PATCH] addressing lint issues --- pkg/commands/copy.go | 4 ++-- pkg/commands/copy_test.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/commands/copy.go b/pkg/commands/copy.go index 0dd427239..55b635ea0 100644 --- a/pkg/commands/copy.go +++ b/pkg/commands/copy.go @@ -140,12 +140,12 @@ func (c *CopyCommand) RequiresUnpackedFS() bool { return true } -func (r *CopyCommand) ShouldCacheOutput() bool { +func (c *CopyCommand) ShouldCacheOutput() bool { return true } // CacheCommand returns true since this command should be cached -func (r *CopyCommand) CacheCommand(img v1.Image) DockerCommand { +func (c *CopyCommand) CacheCommand(img v1.Image) DockerCommand { return &CachingCopyCommand{ img: img, diff --git a/pkg/commands/copy_test.go b/pkg/commands/copy_test.go index d1d33306f..fcdbf517f 100644 --- a/pkg/commands/copy_test.go +++ b/pkg/commands/copy_test.go @@ -56,6 +56,9 @@ func setupTestTemp() string { logrus.Infof("Tempdir: %s", tempDir) srcPath, err := filepath.Abs("../../integration/context") + if err != nil { + logrus.Fatalf("error getting abs path %s", srcPath) + } cperr := filepath.Walk(srcPath, func(path string, info os.FileInfo, err error) error { if path != srcPath { @@ -71,16 +74,16 @@ func setupTestTemp() string { os.MkdirAll(tempDir+"/"+tempPath, 0777) } else { out, err := os.Create(tempDir + "/" + tempPath) - defer out.Close() if err != nil { return err } + defer out.Close() in, err := os.Open(path) - defer in.Close() if err != nil { return err } + defer in.Close() _, err = io.Copy(out, in) if err != nil { @@ -119,7 +122,6 @@ func TestCopyExecuteCmd(t *testing.T) { buildArgs := copySetUpBuildArgs() dest := cfg.WorkingDir + "/" + test.sourcesAndDest[len(test.sourcesAndDest)-1] logrus.Infof("dest dir: %s", dest) - //os.RemoveAll(dest) err := cmd.ExecuteCommand(cfg, buildArgs) if err != nil {