Skip to content

Commit

Permalink
minikube cp will create nonexisten directory instead of fail
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Jirku <martin@jirku.sk>
  • Loading branch information
martinjirku committed Dec 2, 2023
1 parent 79e9eb6 commit cd1af85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/minikube/command/ssh_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (s *SSHRunner) Copy(f assets.CopyableFile) error {
return nil
})

scp := fmt.Sprintf("sudo test -d %s && sudo scp -t %s", f.GetTargetDir(), f.GetTargetDir())
scp := fmt.Sprintf("sudo mkdir -p %s && sudo scp -t %s", f.GetTargetDir(), f.GetTargetDir())
mtime, err := f.GetModTime()
if err != nil {
klog.Infof("error getting modtime for %s: %v", dst, err)
Expand Down
3 changes: 3 additions & 0 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,9 @@ func validateCpCmd(ctx context.Context, t *testing.T, profile string) {

tmpPath := filepath.Join(tmpDir, "cp-test.txt")
testCpCmd(ctx, t, profile, profile, dstPath, "", tmpPath)

// copy to nonexistent directory structure
testCpCmd(ctx, t, profile, "", srcPath, "", "/tmp/does/not/exist/cp-test.txt")
}

// validateMySQL validates a minimalist MySQL deployment
Expand Down

0 comments on commit cd1af85

Please sign in to comment.