mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
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>
21 lines
422 B
Go
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
|
|
}
|