blazzy/podman-rest-client

Config::guess fails on Linux

Closed this issue · 1 comments

use podman_rest_client::{Config, PodmanRestClient};

let client = PodmanRestClient::new(Config::guess().await?).await?;
Error: No default podman connection info found
id
uid=1000(admin) gid=1000(admin) groups=1000(admin),965(docker),985(video),991(lp),994(input),998(wheel)

❯ ls -lh /run/user/1000/podman/podman.sock
srw-rw---- admin admin 0 B Mon Jul 22 19:13:52 2024 󰆨 /run/user/1000/podman/podman.sock
                                                                                                      [ 0s004 | Jul 22 07:16PM ]

~/Coding/git/rs_libraries/packages/podman_cli main !4 ?1                                                                  1.79.0
❯ systemctl --user status podman.socket
● podman.socket - Podman API Socket
     Loaded: loaded (/usr/lib/systemd/user/podman.socket; disabled; preset: enabled)
     Active: active (listening) since Mon 2024-07-22 19:13:52 -05; 2min 47s ago
 Invocation: bc03a3c258384a249d200f4dd56fb6be
   Triggers: ● podman.service
       Docs: man:podman-system-service(1)
     Listen: /run/user/1000/podman/podman.sock (Stream)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/podman.socket

Jul 22 19:13:52 linken-laptop-main systemd[890]: Stopping Podman API Socket...
Jul 22 19:13:52 linken-laptop-main systemd[890]: Listening on Podman API Socket.
System:
  Kernel: 6.9.10-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.1.1
    clocksource: tsc avail: hpet,acpi_pm parameters: initrd=\initramfs-linux.img
    root=LABEL=OSRoot rootfstype=bcachefs rootflags=relatime rw
    pcie_aspm.policy=powersupersave transparent_hugepage=madvise nowatchdog
    loglevel=4 resume=LABEL=Swap amd_pstate=guided zswap.enabled=1
    zswap.compressor=zstd zswap.max_pool_percent=20 zswap.zpool=z3fold
  Desktop: Hyprland v: N/A tools: swayidle avail: swaylock dm: SDDM
    Distro: Arch Linux

Debug reveals:

            println!("user_socket_exists {user_socket_exists}");
            println!("user_socket_path {user_socket_path}");
            println!("uid {uid}");
user_socket_exists false
user_socket_path unix:///run/user/1000/podman/podman.sock
uid 1000
Error: No default podman connection info found

The path is a unix path, which is incorrect to see if exists from a FS perspective.
unix:// needs to be removed before checking it's existence.