-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Issue Description
On windows, using an absolute path for the podman kube play <path>
lead to unsupported protocol scheme "c"
. I noticed this while writing tests for #26280
Steps to reproduce the issue
Steps to reproduce the issue
- Be on windows
- Run
podman kube play <absolute-path>
- assert
unsupported protocol scheme "c"
Describe the results you received
unsupported protocol scheme "c"
Describe the results you expected
A working command
podman info output
N/A
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
When passing as argument to podman kube play [ARG]
the validURL
function is called first
podman/cmd/podman/kube/play.go
Line 372 in 34de0fe
case parse.ValidURL(fileName) == nil: |
The logic is the following if validURL then http.get else os.Open
. However, the validURL
has a flaw, it consider a valid url windows path, therefore, any absolute path is sent to the http.get which throw unsupported protocol scheme "c"
.
Solution proposal
Rename validURL
to validWebURL
and ensure the Scheme is http
or https
. So we don't get false positive with scheme like c
.
The ValidURL
is used in two places; podman import
and podman kube play
, therefore, both only support http(s) anyway, so let's make the function a little more strict, so it return false, when passing windows path.
Activity
lsm5 commentedon Jun 11, 2025
I'm guessing you're seeing this with main branch itself?
@l0rd @baude I think you're the right people for kube play and windows.
l0rd commentedon Jun 11, 2025
Yes. I was able to reproduce the issue too and @axel7083 has submitted a PR (that I haven't tested yet).
fix(cmd): improve ValidURL reliability