You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend/user_services_functions/copy_files_from_user_service.go
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ import (
11
11
"github.com/kurtosis-tech/stacktrace"
12
12
"io"
13
13
apiv1 "k8s.io/api/core/v1"
14
+
"path/filepath"
14
15
)
15
16
16
17
const (
@@ -55,9 +56,17 @@ func CopyFilesFromUserService(
55
56
)
56
57
}
57
58
59
+
// we remove trailing slash
60
+
srcPath=filepath.Clean(srcPath)
61
+
// we get the base dir | file
62
+
srcPathBase:=filepath.Base(srcPath)
63
+
// we get the dir that holds base the dir | file
64
+
srcPathDir:=filepath.Dir(srcPath)
65
+
58
66
commandToRun:=fmt.Sprintf(
59
-
`if command -v 'tar' > /dev/null; then tar cf - '%v'; else echo "Cannot copy files from path '%v' because the tar binary doesn't exist on the machine" >&2; exit 1; fi`,
60
-
srcPath,
67
+
`if command -v 'tar' > /dev/null; then cd '%v' && tar cf - '%v'; else echo "Cannot copy files from path '%v' because the tar binary doesn't exist on the machine" >&2; exit 1; fi`,
0 commit comments