spiegel_podman/pkg/machine/shim/volume.go
Brent Baude 2cc3be7332
RUN-4539: Change podman module paths
The podman module paths are moving from github.com/containers/podman to
go.podman.io/podman.  This will help with future mobility.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-22 14:02:25 -05:00

33 lines
845 B
Go

package shim
import (
"go.podman.io/podman/v6/pkg/machine"
"go.podman.io/podman/v6/pkg/machine/vmconfigs"
)
func CmdLineVolumesToMounts(volumes []string, volumeType vmconfigs.VolumeMountType) []*vmconfigs.Mount {
mounts := []*vmconfigs.Mount{}
for i, volume := range volumes {
if volume == "" {
continue
}
var mount vmconfigs.Mount
tag, source, target, readOnly, _ := vmconfigs.SplitVolume(i, volume)
switch volumeType {
case vmconfigs.VirtIOFS:
virtioMount := machine.NewVirtIoFsMount(source, target, readOnly)
mount = virtioMount.ToMount()
default:
mount = vmconfigs.Mount{
Type: volumeType.String(),
Tag: tag,
Source: source,
Target: target,
ReadOnly: readOnly,
OriginalInput: volume,
}
}
mounts = append(mounts, &mount)
}
return mounts
}