diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-16 06:04:22 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-28 14:26:22 -0500 |
commit | 3dc1b8e83f2459a58d65f3bb918975cd6f1bb794 (patch) | |
tree | 15a3d902665203a36ad06965e79997434567e8c5 /libpod/volume.go | |
parent | c39dffe83db9fa3cfa6897b971956821f1bbcce2 (diff) | |
download | podman-3dc1b8e83f2459a58d65f3bb918975cd6f1bb794.tar.gz podman-3dc1b8e83f2459a58d65f3bb918975cd6f1bb794.tar.bz2 podman-3dc1b8e83f2459a58d65f3bb918975cd6f1bb794.zip |
Add podman volume mount support
Fixes: https://github.com/containers/podman/issues/12768
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/volume.go')
-rw-r--r-- | libpod/volume.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/volume.go b/libpod/volume.go index d60d978ed..f79ceaa87 100644 --- a/libpod/volume.go +++ b/libpod/volume.go @@ -255,3 +255,16 @@ func (v *Volume) IsDangling() (bool, error) { func (v *Volume) UsesVolumeDriver() bool { return !(v.config.Driver == define.VolumeDriverLocal || v.config.Driver == "") } + +func (v *Volume) Mount() (string, error) { + v.lock.Lock() + defer v.lock.Unlock() + err := v.mount() + return v.config.MountPoint, err +} + +func (v *Volume) Unmount() error { + v.lock.Lock() + defer v.lock.Unlock() + return v.unmount(false) +} |