Skip to content
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

copier: add NoOverwriteNonDirDir option #4043

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

vrothberg
Copy link
Member

Similar to the NoOverwriteDirNonDir one, add an option that disables
non-directories from being overwritten by directories.

Required-for: containers/podman/issues/14420
Signed-off-by: Valentin Rothberg [email protected]

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add a new option to copier.Put to throw an error if a non-dir is overwritten with a dir. Needed for Docker-compat in podman cp.

How to verify it

go test -v ./copier.

Does this PR introduce a user-facing change?

Add a new `NoOverwriteNonDirDir` option to `copier.Put` to prevent a non-directory from being overwritten by a directory.

@nalind PTAL

@vrothberg vrothberg force-pushed the nondirdir branch 2 times, most recently from e22e0e6 to 7192a9d Compare June 7, 2022 13:17
Copy link
Member

@nalind nalind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with an optional nit. The unit test is much appreciated!

copier/copier.go Show resolved Hide resolved
Similar to the `NoOverwriteDirNonDir` one, add an option that disables
non-directories from being overwritten by directories.

Required-for: containers/podman/issues/14420
Signed-off-by: Valentin Rothberg <[email protected]>
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, nalind, 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:
  • OWNERS [flouthoc,nalind,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vrothberg
Copy link
Member Author

CI queue seems slow today.

@vrothberg
Copy link
Member Author

/hold cancel

@openshift-merge-robot openshift-merge-robot merged commit 3f2df82 into containers:main Jun 7, 2022
@vrothberg vrothberg deleted the nondirdir branch June 7, 2022 17:35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants