Add container inspect wrapper for podman 4 - #13
Conversation
The inspect format differed in some types like StopSignal, making Unmarshal fail when using podman instead of docker. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
|
Just realized that you're also a contributor of Podman, which is cool. I was a bit hesitant about whether I should have a dedicated package like What do you think? |
|
I think it is fine to focus on Docker (only), and leave the compatibility to Podman and small workarounds (like this one) But moving docker.InspectObject into pkg/docker sounds like it could be a good idea, to simplify pkg/cluster a bit? |
|
Another (small) optimization could be to call i.e. |
The inspect format differed in some types like StopSignal, making Unmarshal fail when using podman instead of docker.
Without this fix, podman breaks:
Error: json: cannot unmarshal number into Go struct field Config.Config.StopSignal of type stringWith this fix, podman 4.9.3 works.
Using the docker pkg/signal (now in moby) and the podman pkg/signal helper functions, instead of importing all of libpod.
This is a NOOP, on other OS.
Since they can be updated*...
* That is, running a newer Podman 5 in the Podman Machine instead of the one that is available in the Linux distribution.
Closes #9
https://github.com/containers/podman/blob/v5.4.0/libpod/define/container_inspect.go#L111
https://github.com/containers/podman/blob/v5.4.0/pkg/signal/signal_common.go#L66