Merge pull request #27534 from matejvasek/revert-copyuidgid-inversion

Revert "Fix copyUIDGID parameter inversion in Docker compat API"
This commit is contained in:
openshift-merge-bot[bot]
2025-11-14 14:41:29 +00:00
committed by GitHub
3 changed files with 4 additions and 51 deletions

View File

@@ -123,17 +123,9 @@ func handlePut(w http.ResponseWriter, r *http.Request, decoder *schema.Decoder,
containerName := utils.GetName(r)
containerEngine := abi.ContainerEngine{Libpod: runtime}
// Docker API semantics: copyUIDGID=true means "preserve UID/GID from archive"
// Podman internal semantics: Chown=true means "chown to container user" (override archive)
// For compat requests, we need to invert the value
chown := query.Chown
if !utils.IsLibpodRequest(r) {
chown = !query.Chown
}
copyFunc, err := containerEngine.ContainerCopyFromArchive(r.Context(), containerName, query.Path, r.Body,
entities.CopyOptions{
Chown: chown,
Chown: query.Chown,
NoOverwriteDirNonDir: query.NoOverwriteDirNonDir,
Rename: rename,
})