Skip to content

bug(kube play): cannot use absolute path on windows #26350

@axel7083

Description

@axel7083
Contributor

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

  1. Be on windows
  2. Run podman kube play <absolute-path>
  3. 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

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

added
kind/bugCategorizes issue or PR as related to a bug.
on Jun 11, 2025
lsm5

lsm5 commented on Jun 11, 2025

@lsm5
Member

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

l0rd commented on Jun 11, 2025

@l0rd
Member

Yes. I was able to reproduce the issue too and @axel7083 has submitted a PR (that I haven't tested yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @lsm5@l0rd@axel7083

      Issue actions

        bug(kube play): cannot use absolute path on windows · Issue #26350 · containers/podman