[Fixes: #27571] Fix 'shouldResolveWinPaths' returning 'false' on Windows

Signed-off-by: Vyacheslav Bespalov <vbespalov@ptsecurity.com>
This commit is contained in:
Vyacheslav Bespalov
2025-11-21 12:23:29 +03:00
parent fac259ef9c
commit a331c51c05
2 changed files with 6 additions and 1 deletions

View File

@@ -67,6 +67,10 @@ func TestSplitVolumeString(t *testing.T) {
}, },
} }
t.Run("shouldResolveWinPaths() returns true", func(t *testing.T) {
assert.True(t, shouldResolveWinPaths())
})
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
parts := SplitVolumeString(tt.volume) parts := SplitVolumeString(tt.volume)

View File

@@ -6,7 +6,8 @@ import (
) )
func shouldResolveWinPaths() bool { func shouldResolveWinPaths() bool {
return machine.HostType() == "wsl" hostType := machine.HostType()
return hostType == machine.Wsl || hostType == machine.HyperV
} }
func shouldResolveUnixWinVariant(path string) bool { func shouldResolveUnixWinVariant(path string) bool {