Files
podman/pkg/machine/e2e/config_list_test.go
Brent Baude 5e1c2f8d7d 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>
2025-10-29 07:59:34 -05:00

51 lines
1.0 KiB
Go

package e2e_test
type listMachine struct {
/*
--format string Format volume output using JSON or a Go template (default "{{.Name}}\t{{.VMType}}\t{{.Created}}\t{{.LastUp}}\t{{.CPUs}}\t{{.Memory}}\t{{.DiskSize}}\n")
--noheading Do not print headers
-q, --quiet Show only machine names
*/
format string
noHeading bool
quiet bool
allProviders bool
cmd []string
}
func (i *listMachine) buildCmd(_ *machineTestBuilder) []string {
cmd := []string{"machine", "list"}
if len(i.format) > 0 {
cmd = append(cmd, "--format", i.format)
}
if i.noHeading {
cmd = append(cmd, "--noheading")
}
if i.quiet {
cmd = append(cmd, "--quiet")
}
if i.allProviders {
cmd = append(cmd, "--all-providers")
}
i.cmd = cmd
return cmd
}
func (i *listMachine) withNoHeading() *listMachine {
i.noHeading = true
return i
}
func (i *listMachine) withQuiet() *listMachine {
i.quiet = true
return i
}
func (i *listMachine) withFormat(format string) *listMachine {
i.format = format
return i
}