mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
Machine init --provider
Add the ability for users to override the default provider when creating mahcines. The new flag is `--provider` and allows you to specifiy a valid vmtype for the platform. This PR also removes the previous list test where we tested listing all providers. I added a PR for testing --provider which includes a standard `machine ls` which defaults now to showing all providers. Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@@ -30,18 +30,24 @@ func Get() (vmconfigs.VMProvider, error) {
|
||||
}
|
||||
|
||||
logrus.Debugf("Using Podman machine with `%s` virtualization provider", resolvedVMType.String())
|
||||
switch resolvedVMType {
|
||||
case define.QemuVirt:
|
||||
return qemu.NewStubber()
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
|
||||
}
|
||||
return GetByVMType(resolvedVMType)
|
||||
}
|
||||
|
||||
func GetAll() []vmconfigs.VMProvider {
|
||||
return []vmconfigs.VMProvider{new(qemu.QEMUStubber)}
|
||||
}
|
||||
|
||||
// GetByVMType takes a VMType (presumably from ParseVMType) and returns the correlating
|
||||
// VMProvider
|
||||
func GetByVMType(resolvedVMType define.VMType) (vmconfigs.VMProvider, error) {
|
||||
switch resolvedVMType {
|
||||
case define.QemuVirt:
|
||||
return qemu.NewStubber()
|
||||
default:
|
||||
}
|
||||
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
|
||||
}
|
||||
|
||||
// SupportedProviders returns the providers that are supported on the host operating system
|
||||
func SupportedProviders() []define.VMType {
|
||||
return []define.VMType{define.QemuVirt}
|
||||
|
||||
Reference in New Issue
Block a user