-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman cp: do not overwrite non-dirs with dirs and vice versa #14526
Conversation
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 think the API still defaults to overwrite, at least I see no changes in here for that.
Added more tests but just noticed that the remote errors don't work as expected. |
@flouthoc the recent buildah changes are biting my butt. Should the logfile test be skipped on remote? I don't see --logfile being plugged into remote. |
|
@vrothberg It would need implementation on API end. Yes please feel free to skip it for now and i'll pick it up in a followup. |
Does it make sense for remote? The file should ultimately be written on the client-side ... I guess |
@vrothberg Umm.. I am confused 😕 as of now since i don't see a skip for @vrothberg On the podman man-page could we add that |
Note that the bud-logfile-with-split-logfile-by-platform test is skipped on the remote client (see containers#14544). Signed-off-by: Valentin Rothberg <[email protected]>
Add a new `--overwrite` flag to `podman cp` to allow for overwriting in case existing users depend on the behavior; they will have a workaround. By default, the flag is turned off to be compatible with Docker and to have a more sane behavior. Fixes: containers#14420 Signed-off-by: Valentin Rothberg <[email protected]>
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rhatdan PTAL |
/lgtm |
if ! is_remote; then # remote just returns a 500 | ||
is "$output" ".* error creating \"/tmp/foo\": .*: file exists.*" | ||
fi |
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 is the error message different? We should return a reasonable error for the remote client.
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.
We send 200 before (and hence can't overwrite the code) and use the ResponseWriter as the writer. To fix it, we should probably copy the archive to a temporary file and then copy that over the wire.
Add a new
--overwrite
flag topodman cp
to allow for overwriting incase existing users depend on the behavior; they will have a workaround.
By default, the flag is turned off to be compatible with Docker and to
have a more sane behavior.
Fixes: #14420
Signed-off-by: Valentin Rothberg [email protected]
Does this PR introduce a user-facing change?
@Luap99 @mheon @jwhonce PTAL