mirror of
https://github.com/containers/podman.git
synced 2025-11-01 22:32:50 +08:00
Create pkg/machine/ignition package
Moves all of the ignitionfiles out of the `machine` package and into its own called `ignition`. This required `VMType` to get moved out of the `machine` package and into the `define` package in order to prevent a circular dependency. Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/podman/v4/pkg/machine"
|
||||
"github.com/containers/podman/v4/pkg/machine/applehv"
|
||||
"github.com/containers/podman/v4/pkg/machine/define"
|
||||
"github.com/containers/podman/v4/pkg/machine/qemu"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -20,16 +21,16 @@ func Get() (machine.VirtProvider, error) {
|
||||
if providerOverride, found := os.LookupEnv("CONTAINERS_MACHINE_PROVIDER"); found {
|
||||
provider = providerOverride
|
||||
}
|
||||
resolvedVMType, err := machine.ParseVMType(provider, machine.AppleHvVirt)
|
||||
resolvedVMType, err := define.ParseVMType(provider, define.AppleHvVirt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logrus.Debugf("Using Podman machine with `%s` virtualization provider", resolvedVMType.String())
|
||||
switch resolvedVMType {
|
||||
case machine.QemuVirt:
|
||||
case define.QemuVirt:
|
||||
return qemu.VirtualizationProvider(), nil
|
||||
case machine.AppleHvVirt:
|
||||
case define.AppleHvVirt:
|
||||
return applehv.VirtualizationProvider(), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
|
||||
|
||||
Reference in New Issue
Block a user