mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-21 15:57:54 +00:00
The InstalledProviders and SupportedProviders functions were only used in their own tests and were otherwise dead code. Removing them entirely cleans up the API surface. Signed-off-by: Aryanbhargava18 <aryanbhargava644@gmail.com>
29 lines
710 B
Go
29 lines
710 B
Go
package provider
|
|
|
|
import (
|
|
"go.podman.io/podman/v6/pkg/machine/env"
|
|
"go.podman.io/podman/v6/pkg/machine/vmconfigs"
|
|
)
|
|
|
|
// GetAllMachinesAndRootfulness collects all podman machine configs and returns
|
|
// a map in the format: { machineName: isRootful }
|
|
func GetAllMachinesAndRootfulness() (map[string]bool, error) {
|
|
providers := GetAll()
|
|
machines := map[string]bool{}
|
|
for _, provider := range providers {
|
|
dirs, err := env.GetMachineDirs(provider.VMType())
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
providerMachines, err := vmconfigs.LoadMachinesInDir(dirs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
for n, m := range providerMachines {
|
|
machines[n] = m.HostUser.Rootful
|
|
}
|
|
}
|
|
|
|
return machines, nil
|
|
}
|