mirror of https://github.com/containers/podman.git
Merge pull request #19238 from dfr/freebsd-copy
libpod: use define.TypeBind when resolving container paths
This commit is contained in:
commit
a56370db48
|
@ -5,6 +5,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/containers/podman/v4/libpod/define"
|
||||||
securejoin "github.com/cyphar/filepath-securejoin"
|
securejoin "github.com/cyphar/filepath-securejoin"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
@ -155,7 +156,7 @@ func isPathOnVolume(c *Container, containerPath string) bool {
|
||||||
func findBindMount(c *Container, containerPath string) *specs.Mount {
|
func findBindMount(c *Container, containerPath string) *specs.Mount {
|
||||||
cleanedPath := filepath.Clean(containerPath)
|
cleanedPath := filepath.Clean(containerPath)
|
||||||
for _, m := range c.config.Spec.Mounts {
|
for _, m := range c.config.Spec.Mounts {
|
||||||
if m.Type != "bind" {
|
if m.Type != define.TypeBind {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if cleanedPath == filepath.Clean(m.Destination) {
|
if cleanedPath == filepath.Clean(m.Destination) {
|
||||||
|
|
Loading…
Reference in New Issue