Skip to content

Commit

Permalink
Remove -r option from mv command (#1696)
Browse files Browse the repository at this point in the history
Error with this option causing artifacts not to be moved for CI

Fixes #1692

Signed-off-by: John Schnake <jschnake@vmware.com>
  • Loading branch information
johnSchnake committed May 9, 2022
1 parent be9293d commit 8690c6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/integration/sonobuoy_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ func checkTarballPluginForErrors(t *testing.T, tarball, plugin string, failCount
}

func saveToArtifacts(t *testing.T, p string) (newPath string) {
p = strings.TrimSpace(p)
artifactsDir := os.Getenv("ARTIFACTS_DIR")
if artifactsDir == "" {
t.Logf("Skipping saving artifact %v since ARTIFACTS_DIR is unset.", p)
Expand All @@ -439,7 +440,7 @@ func saveToArtifacts(t *testing.T, p string) (newPath string) {
var stdout, stderr bytes.Buffer

// Shell out to `mv` instead of using os.Rename(); the latter caused a problem due to files being on different devices.
cmd := exec.CommandContext(context.Background(), bash, "-c", fmt.Sprintf("mv -r %v %v", origFile, artifactFile))
cmd := exec.CommandContext(context.Background(), bash, "-c", fmt.Sprintf("mv %v %v", origFile, artifactFile))
cmd.Stdout = &stdout
cmd.Stderr = &stderr

Expand Down

0 comments on commit 8690c6c

Please sign in to comment.