mirror of
https://github.com/containers/podman.git
synced 2025-09-19 23:03:16 +08:00
Support for Windows paths in the source position of the volume mounts
There are 2 things added. First there is added support for handling drive letters while doing value split. If drive letter is detected, then max number of elements will be increased by one, but then first two will be concatenated to reconstruct the path. Second part is basic, but working, conversion of Windows path to Unix path to be used, when target path is not explicitly specified. Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
This commit is contained in:
@ -6,6 +6,7 @@ package qemu
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@ -31,3 +32,14 @@ func checkProcessStatus(processHint string, pid int, stderrBuf *bytes.Buffer) er
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func pathsFromVolume(volume string) []string {
|
||||
return strings.SplitN(volume, ":", 3)
|
||||
}
|
||||
|
||||
func extractTargetPath(paths []string) string {
|
||||
if len(paths) > 1 {
|
||||
return paths[1]
|
||||
}
|
||||
return paths[0]
|
||||
}
|
||||
|
Reference in New Issue
Block a user