Skip to content

Commit

Permalink
Merge pull request #17715 from martinjirku/MK-17576-fix-deep-directory
Browse files Browse the repository at this point in the history
minikube cp create non-existing directory instead of failing
  • Loading branch information
spowelljr authored Dec 12, 2023
2 parents 2f75521 + cd1af85 commit 9365f75
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 9365f75

Please sign in to comment.