Closed jsg24 closed 1 year ago
Thanks for this, will take a deeper look in a bit. In the meantime, does using :NetworkConnectLibpod instead of :NetworkConnect for podman make any difference? The docker compatible api for podman could have some rough edges.
Podman supports both the APIs and the native ones have a Libpod suffix. In my experience they seem to work better than the docker compatible ones.
We've found that :NetworkConnectLibpod
doesn't seem to be available, these are the available :ops we can see:
(def dr-networks (cj/client
{:engine :podman
:category :networks
:conn {:uri (docker-uri)}
:version "v3.4.4"}
))
(cj/ops dr-networks)
;; =>
(:NetworkList :NetworkInspect :NetworkDelete :NetworkConnect :NetworkDisconnect :NetworkCreate :NetworkPrune)
But forcing the network :NetworkConnectLibpod
gets this error:
----- Error --------------------------------------------------------------------
Type: java.lang.IllegalArgumentException
Message: Invalid operation NetworkConnectLibpod for category networks
Location: contajners/impl.cljc:16:3
----- Context ------------------------------------------------------------------
12: [java.util.regex Pattern]))
13:
14: (defn bail-out
15: [^String message]
16: (throw (IllegalArgumentException. message)))
^--- Invalid operation NetworkConnectLibpod for category networks
17:
18: (defn remove-internal-meta
19: "Removes keywords namespaced with :contajners. They are for internal use."
20: [data-seq]
21: (remove #(= "contajners" (namespace %)) data-seq))
PS: We're using contajners version 1.0.0 .
Try a newer version of the API? The current version is v4.4.4. That's a fairly old version of Podman.
You may need to use contajners as a git dep for this, it's not released into clojars yet. Latest supported version by the released one is v4.4.0.
Hi. We upgraded podman to 4.4.4 but we couldn't see the :NetworkConnectLibpod
option.
Upgraded dependency:
lispyclouds/contajners {:git/url "https://github.com/lispyclouds/contajners"
:git/sha "ad4ffbb5f1972de9815c00f4c6d59b70101ec0a5"}
Our results:
(def dr-networks (cj/client
{:engine :podman
:category :networks
:conn {:uri (docker-uri)}
:version "v4.4.4"}
))
(cj/ops dr-networks)
;; =>
(:NetworkList :NetworkInspect :NetworkDelete :NetworkConnect :NetworkDisconnect :NetworkCreate :NetworkPrune)
Using :category :libpod/networks
not :networks
should do it. The non namespaced one is for us to support both the APIs in Podman. Will add some docs for this.
Thanks, but this means we need to change a number of other operations like :NetworkInspect
etc, all the while these scripts have to work for colleagues using docker. A bit too complex a task at the moment. :(
yeah it is a bit hard to change all that no doubt. but im fairly sure that the discrepancy is coming from podman's emulation of the docker api and not much could be done in contajners itself. if using the latest version of podman has the same issue with this api, a bug report needs to be done on podman. i had a similar issue with container logs.
Closing this as a probable issue in Podman itself. Feel free to reopen otherwise!
Hi there,
I'm not sure whether this is part of your library or an underlying dependency, but the following works on Docker but doesn't work on Podman:
In order to get it to work on Podman, I needed to provide the container ID:
It's a bit tricky for us to update our build script at the moment, so I thought I'd report.
If this is an underlying Podman issue, please feel free to close.