-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cp cmd #643
Cp cmd #643
Conversation
e93a6ff
to
ada4497
Compare
b4d9989
to
bb91977
Compare
13b63ee
to
573c905
Compare
e717ce6
to
61e0efe
Compare
@AkihiroSuda @ktock would you plz review this PR. I have some troubles to pass test
but thus works in my local environnement |
9b1bc6e
to
5278782
Compare
a814a73
to
3283d80
Compare
@AkihiroSuda fixed |
https://cirrus-ci.com/task/6431751521173504?logs=build#L352 (You can just disable |
fb95b26
to
a91732f
Compare
cc @AkihiroSuda |
} | ||
|
||
// recursiveTar makes a tar recursively | ||
func recursiveTar(srcDir, srcBase, dstDir, dstBase string, user runtimespec.User, tw *tar.Writer, archive bool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to mix up the tar
command and Go's archive/tar
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just using tar
command on the host would be simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkihiroSuda I need archive/tar
because I writing to io.PipeWriter
here https://github.com/containerd/nerdctl/pull/643/files#diff-dc36d8c99566d6fecdc69b09e1781108cb3026a4a5dbbfe31e1df4b4d2572c3bR331 . I could have used archive/tar everywhere but it can be a possible evolution (future PR) to avoid a vulnerable binary tar
e10cd7e
to
05b1840
Compare
// So we first replace each slash ('/') character in path with a separator character | ||
// then we clean the path. | ||
// A trailing "." is preserved if the original path specified the current directory. | ||
func SplitPathDirEntry(path string) (dir, base string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/search?q=SplitPathDirEntry&type=code
When you copied codes from somewhere else, please confirm the origin and the license.
Docker:
This PR: $ nerdctl run -d --name foo alpine sleep infinity
$ nerdctl cp .bashrc foo:/foo
FATA[0000] /foo should exists
$ nerdctl cp .bashrc foo:/
$ nerdctl exec foo ls -l /.bashrc
-rw-r--r-- 1 root root 4209 Apr 18 08:24 /.bashrc
|
Carry PR: |
nerdctl cp design #212
PS: only running container is support for the moment. I will implement not running container in other PR.