You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But windows... amazing windows, absolute path have a drive letter (E.g. C:/hello/world) and the following code is responsible of checking if it is an absolute path
Nice catch @axel7083. A small note: in the description, you use the command podman create volume, but you probably meant podman volume create.
Are you going to submit a PR for this? Considering the analysis you have already done, it should not be hard. If you do, you want to start by adding a new test in machine e2e volumes.
Issue Description
When trying to mount a volume which has a name which is a single character on windows, ( e.g.
a
,b
,c
etc.) an error is throwed.Deep dive
On windows, the parsing of the volume argument is a bit tricky.
volumeFlag = ["a:/mnt/home"]
podman/pkg/specgenutil/volumes.go
Line 46 in 806722b
[[SOURCE-VOLUME|HOST-DIR:]CONTAINER-DIR[:OPTIONS]]
podman/pkg/specgen/volumes.go
Line 208 in 693ae0e
podman/pkg/specgen/volumes.go
Lines 220 to 224 in 693ae0e
hasWinDriveScheme
podman/pkg/specgen/winpath.go
Lines 14 to 21 in a46f798
In our example,
path = "a:/mnt/home", start = 0
.len(path) < start+2 = false
path[start+1] != ':' = false
(problematic, it is confusing the colon separating the driver letter with the separator of the volume and container pathThe last part is checking if the letter is a driver letter accepted value.
Steps to reproduce the issue
Run the following on windows
$: podman create volume a a $: podman run -v a:/mnt/ hello-world Error: invalid container path "a:/mnt", must be an absolute path
Describe the results you received
On windows, I am getting the following error
Describe the results you expected
Volume to be mounted.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
N/A
Additional information
N/A
The text was updated successfully, but these errors were encountered: