cli/command/container: don't set CopyToContainerOptions.AllowOverwriteDirWithFile#6176
Merged
thaJeztah merged 1 commit intodocker:masterfrom Jul 14, 2025
Merged
Conversation
…eDirWithFile The `AllowOverwriteDirWithFile` option was added when reimplementing the CLI using the API Client lib in [moby@1b2b91b]. Before that refactor, the `noOverwriteDirNonDir` query argument [would be set unconditionally][1] by the CLI, with no options to control the behavior. It's unclear why the `noOverwriteDirNonDir` was implemented as opt-in (not opt-out), as overwriting a file with a directory (or vice-versa) would generally be unexpected behavior. We're considering making `noOverwriteDirNonDir` unconditional on the daemon side, and to deprecate the `AllowOverwriteDirWithFile` option. This patch removes its use, as it was set to the default either way, and there's no options to configure it from the CLI. [1]: https://github.com/moby/moby/blob/8c9ad7b818c0a7b1e39f8df1fabba243a0961c2d/api/client/cp.go#L345-L346 [moby@1b2b91b]: moby/moby@1b2b91b Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
vvoland
approved these changes
Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
relates to:
cli/command/container: don't set CopyToContainerOptions.AllowOverwriteDirWithFile
The
AllowOverwriteDirWithFileoption was added when reimplementing the CLI using the API Client lib in moby@1b2b91b. Before that refactor, thenoOverwriteDirNonDirquery argument would be set unconditionally by the CLI, with no options to control the behavior.It's unclear why the
noOverwriteDirNonDirwas implemented as opt-in (not opt-out), as overwriting a file with a directory (or vice-versa) would generally be unexpected behavior.We're considering making
noOverwriteDirNonDirunconditional on the daemon side, and to deprecate theAllowOverwriteDirWithFileoption. This patch removes its use, as it was set to the default either way, and there's no options to configure it from the CLI.- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)