docker-hs
docker-hs copied to clipboard
inspectContainer fails decoding
hello I get 2 errors inspecting containers
-
[WARN] DockerClientDecodeError "Error in $.Config.Cmd: parsing [] failed, expected Array, but encountered Null"
-
[WARN] DockerClientDecodeError "Error in $.Config: key \"StopSignal\" not found"
[a.pv@ansible 18:07:21 ~] docker version
Client: Docker Engine - Community
Version: 20.10.11
API version: 1.41
Go version: go1.16.9
Git commit: dea9396
Built: Thu Nov 18 00:38:53 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.11
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: 847da18
Built: Thu Nov 18 00:37:17 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
where should I look to fix them? any hint very appreciated
Hi @paolino. If you want to fix this, you probably need to modify the FromJSON
instance for ContainerConfig
to parse a null "Cmd"
as []
. For "StopSignal"
, I'm not sure what should be returned if the key isn't provided. Maybe SIGTERM
since the API says that's the default.
Can you create a test case for the JSON response you're seeing?
Hi, I changed almost all [x] to a newtype to support 'null' encoding. It's quite an invasive change because it was detecting this all over the ContainerConfig encoding. I have 100 containers in production which slowly made me fix the [x] . But I haven't checked the API docs. Sadly I messed up the indentation and hlint things so a PR is not ready. Btw you can have a look here and if you think it's something useful I can try o port it back to the original style. In that case, I need to know which indenter should I use :-)