mirror of
https://github.com/containers/podman.git
synced 2025-11-02 14:55:28 +08:00
Correct VM existance check on WSL
Replaces GetHyperVisorVMs() with Exists() to better abstract the underlying use-case and slightly imrpove efficiency. Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
This commit is contained in:
@ -94,16 +94,8 @@ func (w WSLStubber) PrepareIgnition(_ *vmconfigs.MachineConfig, _ *ignition.Igni
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (w WSLStubber) GetHyperVisorVMs() ([]string, error) {
|
||||
vms, err := getAllWSLDistros(false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
wslVMs := make([]string, 0)
|
||||
for name := range vms {
|
||||
wslVMs = append(wslVMs, name)
|
||||
}
|
||||
return wslVMs, nil
|
||||
func (w WSLStubber) Exists(name string) (bool, error) {
|
||||
return isWSLExist(machine.ToDist(name))
|
||||
}
|
||||
|
||||
func (w WSLStubber) MountType() vmconfigs.VolumeMountType {
|
||||
|
||||
Reference in New Issue
Block a user