Skip to content

Commit cd1af85

Browse files
committed
minikube cp will create nonexisten directory instead of fail
Signed-off-by: Martin Jirku <[email protected]>
1 parent 79e9eb6 commit cd1af85

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/minikube/command/ssh_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (s *SSHRunner) Copy(f assets.CopyableFile) error {
406406
return nil
407407
})
408408

409-
scp := fmt.Sprintf("sudo test -d %s && sudo scp -t %s", f.GetTargetDir(), f.GetTargetDir())
409+
scp := fmt.Sprintf("sudo mkdir -p %s && sudo scp -t %s", f.GetTargetDir(), f.GetTargetDir())
410410
mtime, err := f.GetModTime()
411411
if err != nil {
412412
klog.Infof("error getting modtime for %s: %v", dst, err)

test/integration/functional_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,9 @@ func validateCpCmd(ctx context.Context, t *testing.T, profile string) {
17741774

17751775
tmpPath := filepath.Join(tmpDir, "cp-test.txt")
17761776
testCpCmd(ctx, t, profile, profile, dstPath, "", tmpPath)
1777+
1778+
// copy to nonexistent directory structure
1779+
testCpCmd(ctx, t, profile, "", srcPath, "", "/tmp/does/not/exist/cp-test.txt")
17771780
}
17781781

17791782
// validateMySQL validates a minimalist MySQL deployment

0 commit comments

Comments
 (0)