aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-11 03:03:31 -0400
committerGitHub <noreply@github.com>2022-05-11 03:03:31 -0400
commitc379014ee4e57dc19669ae92f45f8e4c0814295b (patch)
tree10ea46b3a202da6caa1f6761704d30c67b6e8baf /cmd
parented1ba27f8dc33672e8361c6c1a71cf95b1b79e9a (diff)
parentc7c00ce55199c1e569953a4a03055268ecca147e (diff)
downloadpodman-c379014ee4e57dc19669ae92f45f8e4c0814295b.tar.gz
podman-c379014ee4e57dc19669ae92f45f8e4c0814295b.tar.bz2
podman-c379014ee4e57dc19669ae92f45f8e4c0814295b.zip
Merge pull request #14170 from ashley-cui/machtests
Add more machine tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/machine/list.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/cmd/podman/machine/list.go b/cmd/podman/machine/list.go
index ef26b7886..5254d50cf 100644
--- a/cmd/podman/machine/list.go
+++ b/cmd/podman/machine/list.go
@@ -43,7 +43,7 @@ type listFlagType struct {
quiet bool
}
-type machineReporter struct {
+type ListReporter struct {
Name string
Default bool
Created string
@@ -68,7 +68,7 @@ func init() {
flags := lsCmd.Flags()
formatFlagName := "format"
flags.StringVar(&listFlag.format, formatFlagName, "{{.Name}}\t{{.VMType}}\t{{.Created}}\t{{.LastUp}}\t{{.CPUs}}\t{{.Memory}}\t{{.DiskSize}}\n", "Format volume output using JSON or a Go template")
- _ = lsCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&machineReporter{}))
+ _ = lsCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&ListReporter{}))
flags.BoolVar(&listFlag.noHeading, "noheading", false, "Do not print headers")
flags.BoolVarP(&listFlag.quiet, "quiet", "q", false, "Show only machine names")
}
@@ -121,8 +121,8 @@ func list(cmd *cobra.Command, args []string) error {
return outputTemplate(cmd, machineReporter)
}
-func outputTemplate(cmd *cobra.Command, responses []*machineReporter) error {
- headers := report.Headers(machineReporter{}, map[string]string{
+func outputTemplate(cmd *cobra.Command, responses []*ListReporter) error {
+ headers := report.Headers(ListReporter{}, map[string]string{
"LastUp": "LAST UP",
"VmType": "VM TYPE",
"CPUs": "CPUS",
@@ -181,15 +181,15 @@ func streamName(imageStream string) string {
return imageStream
}
-func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) {
+func toMachineFormat(vms []*machine.ListResponse) ([]*ListReporter, error) {
cfg, err := config.ReadCustomConfig()
if err != nil {
return nil, err
}
- machineResponses := make([]*machineReporter, 0, len(vms))
+ machineResponses := make([]*ListReporter, 0, len(vms))
for _, vm := range vms {
- response := new(machineReporter)
+ response := new(ListReporter)
response.Default = vm.Name == cfg.Engine.ActiveService
response.Name = vm.Name
response.Running = vm.Running
@@ -209,15 +209,15 @@ func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) {
return machineResponses, nil
}
-func toHumanFormat(vms []*machine.ListResponse) ([]*machineReporter, error) {
+func toHumanFormat(vms []*machine.ListResponse) ([]*ListReporter, error) {
cfg, err := config.ReadCustomConfig()
if err != nil {
return nil, err
}
- humanResponses := make([]*machineReporter, 0, len(vms))
+ humanResponses := make([]*ListReporter, 0, len(vms))
for _, vm := range vms {
- response := new(machineReporter)
+ response := new(ListReporter)
if vm.Name == cfg.Engine.ActiveService {
response.Name = vm.Name + "*"
response.Default = true