libpod: Implement 'podman cp' for FreeBSD

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson committed 2022-09-20 08:36:23 +01:00
1 parent 88f82ceab2
commit bb160be12b
6 files changed
+34 -8

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux || freebsd
// +build linux freebsd
package libpod
+13
View 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)
}
+2 -2
View File
@@ -1,5 +1,5 @@
//go:build !linux
// +build !linux
//go:build !linux && !freebsd
// +build !linux,!freebsd
package libpod
+2 -2
View File
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux || freebsd
// +build linux freebsd
package libpod
+13
View 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)
}
+2 -2
View File
@@ -1,5 +1,5 @@
//go:build !linux
// +build !linux
//go:build !linux && !freebsd
// +build !linux,!freebsd
package libpod