-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement containers/{id or name}/archive api #8126
Implement containers/{id or name}/archive api #8126
Conversation
I duplicate some code form Maybe I could create some shared package that would be used by both api and cli. At first I was thinking of calling func (ic *ContainerEngine) ContainerCp(ctx context.Context, source, dest string, options entities.ContainerCpOptions) (*entities.ContainerCpReport, error) , but that would require creating unnecessary temporary files. |
I noticed that # alink -> a
podman cp xyz:/adir/alink . Will copy file that the link points to, i.e user ends up with the |
@matejvasek When I was looking into implementing this, I was using https://github.com/containers/buildah/tree/master/copier - it's a new package designed for secure copy mimicking Docker behavior. The intention was to implement the archive endpoints using it, then swap |
I was using https://github.com/containers/buildah/blob/master/copier/copier.go#L248 for copying out of, and https://github.com/containers/buildah/blob/master/copier/copier.go#L290 for copying into, to be specific. |
@mheon how much have you done implementing it? Does it make sense for me to continue on this PR? |
That Buildah pkg looks nice, it also has |
@matejvasek Feel free to continue, I didn't get very far - got pulled off quickly in favor of other work. |
CLI |
I noticed that |
also with regard to symlinks: when getting a sole symlink directly by |
Pause was an attempt at fixing a CVE that turned out to not be strictly required; I don't believe it's necessary here. |
@matejvasek FYI, we're fine with merging this without support for copying into volumes, at least initially - we can resolve that later, once the basic functionality is in place. |
54db4c6
to
c8a98d1
Compare
It still has one issue, when calling PUT the file is not visible immediately in running container, it's required to stop and start the container again to see the file. |
f666bf9
to
be06ac1
Compare
I noticed that |
That sounds very strange... @nalind Any thoughts? |
@mheon is |
I don't know if it changes anything, but I am running cgroups v1, not v2. |
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
Signed-off-by: Matej Vasek <[email protected]>
63da592
to
24ff6f4
Compare
Signed-off-by: Matej Vasek <[email protected]>
d4ebc9b
to
34931ac
Compare
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.
Thanks a lot for the great work, @matejvasek !
return | ||
} | ||
|
||
w.Header().Add("X-Docker-Container-Path-Stat", statHeader) |
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.
I agree. Thanks for clarifying.
LGTM |
@matejvasek thanks! |
/hold |
Do not merge until after 2.2 |
I wonder if that could speed up https://github.com/wagoodman/dive when using |
/hold cancel |
/lgtm |
This is heavily in progress, but I could use any good advice.