summaryrefslogtreecommitdiff
path: root/pkg/specgen/winpath.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/winpath.go')
-rw-r--r--pkg/specgen/winpath.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/specgen/winpath.go b/pkg/specgen/winpath.go
index f4249fab1..0df4ebdd7 100644
--- a/pkg/specgen/winpath.go
+++ b/pkg/specgen/winpath.go
@@ -47,11 +47,12 @@ func ConvertWinMountPath(path string) (string, error) {
path = strings.TrimPrefix(path, `\\?\`)
// Drive installed via wsl --mount
- if strings.HasPrefix(path, `\\.\`) {
+ switch {
+ case strings.HasPrefix(path, `\\.\`):
path = "/mnt/wsl/" + path[4:]
- } else if len(path) > 1 && path[1] == ':' {
+ case len(path) > 1 && path[1] == ':':
path = "/mnt/" + strings.ToLower(path[0:1]) + path[2:]
- } else {
+ default:
return path, errors.New("unsupported UNC path")
}