Skip to content

Commit d9a11d5

Browse files
committed
Ignore docker-desktop WSL distros
1 parent 67561b5 commit d9a11d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/wslapi/wslapi.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"github.com/shayne/go-wsl2-host/pkg/wslcli"
1010
)
1111

12+
const dockerDesktopDistros = "docker-desktop"
13+
1214
// DistroInfo data structure for state of a WSL distro
1315
type DistroInfo struct {
1416
Name string
@@ -49,6 +51,9 @@ func GetAllInfo() ([]*DistroInfo, error) {
4951
return nil, fmt.Errorf("invalid field length for distro: %q", line)
5052
}
5153
info.Name = fields[0]
54+
if strings.HasPrefix(info.Name, dockerDesktopDistros) {
55+
continue
56+
}
5257
info.Running = fields[1] == "Running"
5358
version, err := strconv.ParseInt(fields[2], 10, 0)
5459
if err != nil {

0 commit comments

Comments
 (0)