Files
podman/pkg/machine/shim/volume.go
Matt Heon 34166fc004 Bump Go version to v6
Tremendous amount of changes in here, but all should amount to
the same thing: changing Go import paths from v5 to v6.

Also bumped go.mod to github.com/containers/podman/v6 and updated
version to v6.0.0-dev.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-10-23 11:00:15 -04:00

34 lines
863 B
Go

package shim
import (
"github.com/containers/podman/v6/pkg/machine"
"github.com/containers/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
}