Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #475 failure to inspect podman://ubuntu:24.04 #476

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abitrolly
Copy link
Contributor

@abitrolly abitrolly commented Sep 14, 2023

Fix #475.

Inspecting podman://ubuntu:24.04 fails with the latest revision dive.

$ ./dive podman://ubuntu:24.04
Image Source: docker://podman://ubuntu:24.04
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'podman://ubuntu:24.04'...
cannot fetch image
cannot find docker client executable

The problem is caused by net/url.Parse() (https://go.dev/play/p/0fPOA--41-1).

panic: parse "podman://ubuntu:24.04": invalid port ":24.04" after host

Testing the fix

$ ./divefix podman://ubuntu:24.04
Image Source: podman://ubuntu:24.04
...

$ ./divefix ubuntu:24.04 --source podman
Image Source: podman://ubuntu:24.04
...

$ ./divefix podman://ubuntu:24.04 --source docker
Image Source: podman://ubuntu:24.04
...

`IsSet("source")` returned `true` even if `--source` was not specified.

https://github.com/spf13/viper/releases/tag/v1.6.0
The problem was caused by net/url.Parse()
   panic: parse "podman://docker:23.0.1": invalid port ":23.0.1" after host

Testing the fix
  ✗ ./dive podman://docker:23.0.1
  Image Source: podman://docker:23.0.1

  ✗ ./dive podman://docker:23.0.1 --source docker
  Image Source: podman://docker:23.0.1

  ✗ ./dive docker:23.0.1 --source podman
  Image Source: podman://docker:23.0.1
@abitrolly abitrolly changed the title Fix #475 - can't inspect docker:23.0.1 with podman Fix #475 failure to inspect podman://ubuntu:24.04 Sep 14, 2024
joschi added a commit to joschi/dive that referenced this pull request Nov 7, 2024
The problem was caused by `net/url.Parse()`:
```
panic: parse "podman://ubuntu:24.04": invalid port ":24.04" after host
```

Failure:
```
$ ./dive podman://ubuntu:24.04
Image Source: docker://podman://ubuntu:24.04
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'podman://ubuntu:24.04'...
cannot fetch image
cannot find docker client executable
```

Success:
```
$ ./dive podman://ubuntu:24.04
Image Source: podman://ubuntu:24.04
...

$ ./dive ubuntu:24.04 --source podman
Image Source: podman://ubuntu:24.04
...

$ ./dive podman://ubuntu:24.04 --source docker
Image Source: podman://ubuntu:24.04
...
```

Fixes wagoodman#475

Co-authored-by: Anatoli Babenia <[email protected]>
joschi added a commit to joschi/dive that referenced this pull request Nov 7, 2024
The problem was caused by `net/url.Parse()`:
```
panic: parse "podman://ubuntu:24.04": invalid port ":24.04" after host
```

Failure:
```
$ ./dive podman://ubuntu:24.04
Image Source: docker://podman://ubuntu:24.04
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'podman://ubuntu:24.04'...
cannot fetch image
cannot find docker client executable
```

Success:
```
$ ./dive podman://ubuntu:24.04
Image Source: podman://ubuntu:24.04
...

$ ./dive ubuntu:24.04 --source podman
Image Source: podman://ubuntu:24.04
...

$ ./dive podman://ubuntu:24.04 --source docker
Image Source: podman://ubuntu:24.04
...
```

Fixes wagoodman#475

Co-authored-by: Anatoli Babenia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't inspect docker:23.0.1 through podman
1 participant