Files
podman/pkg/machine/provider/platform.go
Ashley Cui 41f945fc24 machine: Add -all-providers flag to machine list
Podman machine list now supports a new option, --all-providers, which lists all machines from all providers.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-08-28 13:40:50 -04:00

21 lines
422 B
Go

package provider
import (
"github.com/containers/podman/v5/pkg/machine/define"
)
func InstalledProviders() ([]define.VMType, error) {
installedTypes := []define.VMType{}
providers := GetAll()
for _, p := range providers {
installed, err := IsInstalled(p.VMType())
if err != nil {
return nil, err
}
if installed {
installedTypes = append(installedTypes, p.VMType())
}
}
return installedTypes, nil
}