spiegel_podman/cmd
Lokesh Mandvekar f9a57e0e3e
Add build-tagged splits for cp command to support podman-remote
(cherry picked from commit 8fd34d5bfd)

The original cp.go uses buildah/copier which depends on libimage,
making it unavailable in remote builds. This change splits cp
implementation into separate local and remote variants:

- cmd/podman/containers/cp.go: Shared command definitions, flags, and
  init function (no build tag)
- cmd/podman/containers/cp_local.go: Local implementation using
  buildah/copier (//go:build !remote)
- cmd/podman/containers/cp_remote.go: Remote implementation using
  stdlib archive/tar (//go:build remote)

The remote implementation:
- Uses ContainerEngine interface methods that work over REST API:
  ContainerStat, ContainerCopyToArchive, ContainerCopyFromArchive
- Properly handles file and directory copying in both directions
- Uses CopyOptions.Rename for file renaming when copying to specific
  filenames
- Returns error for container-to-container copying (not supported with
  podman-remote)

This follows the same pattern used for other libimage-dependent code
in commit 4231526e18.

Fixes system tests that require cp functionality with podman-remote.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-03-30 15:13:32 -04:00
..
podman Add build-tagged splits for cp command to support podman-remote 2026-03-30 15:13:32 -04:00
podman-mac-helper Fix spelling "read only" -> "read-only" 2022-07-02 08:37:43 +02:00
rootlessport cmd/podman: switch to golang native error wrapping 2022-06-30 12:58:57 +02:00
winpath Fix spelling "setup" -> "set up" and similar 2022-06-22 18:39:21 +02:00