mirror of
https://github.com/containers/podman.git
synced 2025-07-02 08:47:43 +08:00
libpod: Implement 'podman cp' for FreeBSD
[NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
//go:build linux
|
//go:build linux || freebsd
|
||||||
// +build linux
|
// +build linux freebsd
|
||||||
|
|
||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
|
13
libpod/container_copy_freebsd.go
Normal file
13
libpod/container_copy_freebsd.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package libpod
|
||||||
|
|
||||||
|
// On FreeBSD, the container's mounts are in the global mount
|
||||||
|
// namespace so we can just execute the function directly.
|
||||||
|
func (c *Container) joinMountAndExec(f func() error) error {
|
||||||
|
return f()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Similarly, we can just use resolvePath for both running and stopped
|
||||||
|
// containers.
|
||||||
|
func (c *Container) resolveCopyTarget(mountPoint string, containerPath string) (string, string, error) {
|
||||||
|
return c.resolvePath(mountPoint, containerPath)
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
//go:build !linux
|
//go:build !linux && !freebsd
|
||||||
// +build !linux
|
// +build !linux,!freebsd
|
||||||
|
|
||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//go:build linux
|
//go:build linux || freebsd
|
||||||
// +build linux
|
// +build linux freebsd
|
||||||
|
|
||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
|
13
libpod/container_stat_freebsd.go
Normal file
13
libpod/container_stat_freebsd.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package libpod
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/containers/buildah/copier"
|
||||||
|
)
|
||||||
|
|
||||||
|
// On FreeBSD, jails use the global mount namespace, filtered to only
|
||||||
|
// the mounts the jail should see. This means that we can use
|
||||||
|
// statOnHost whether the container is running or not.
|
||||||
|
// container is running
|
||||||
|
func (c *Container) statInContainer(mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) {
|
||||||
|
return c.statOnHost(mountPoint, containerPath)
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
//go:build !linux
|
//go:build !linux && !freebsd
|
||||||
// +build !linux
|
// +build !linux,!freebsd
|
||||||
|
|
||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user