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

bug: pouch inspect can not show zero value #1491

Closed
Ace-Tang opened this issue Jun 8, 2018 · 6 comments · Fixed by #1505
Closed

bug: pouch inspect can not show zero value #1491

Ace-Tang opened this issue Jun 8, 2018 · 6 comments · Fixed by #1505
Assignees
Labels
kind/bug This is bug report for project

Comments

@Ace-Tang
Copy link
Contributor

Ace-Tang commented Jun 8, 2018

Ⅰ. Issue Description

#./pouch inspect 9804f4 
[
    {
        "Args": null,
        "Created": "2018-06-05T08:40:32.540825854Z",
        "ExecIDs": null,
        "GraphDriver": {
            "Data": {
                "MergedDir": "/var/lib/pouch/containerd/state/io.containerd.runtime.v1.linux/default/9804f4bd92d86beff2a3e7a1549cab908ef702d7733227cbb67f07f4ab36d815/rootfs",
                "UpperDir": "/var/lib/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/35/fs"
            },
            "Name": "overlayfs"
        },
        "HostConfig": {
            "LogConfig": {
                "Type": "json-file"
            },
            "NetworkMode": "bridge",
            "OomScoreAdj": -500,
            "RestartPolicy": {
                "Name": "no"
            },
            "Runtime": "runc",
            "BlkioDeviceReadBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceWriteIOps": null,
            "BlkioWeightDevice": null,
            "CgroupParent": "default",
            "DeviceCgroupRules": null,
            "Devices": [],
            "MemoryExtra": 0,
            "MemorySwappiness": -1,
            "MemoryWmarkRatio": 0,
            "OomKillDisable": false,
            "Ulimits": null
        },
        "Id": "9804f4bd92d86beff2a3e7a1549cab908ef702d7733227cbb67f07f4ab36d815",
        "Image": "registry.hub.docker.com/library/busybox:latest",
        "Mounts": [],
        "Name": "9804f4",
        "NetworkSettings": {
            "Networks": {
                "bridge": {
                    "Aliases": null,
                    "EndpointID": "7cc6f90f6179a04ccae8f76e567313a5a304347e2b4f0abf84136bbdf14bda28",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 24,
                    "Links": null,
                    "MacAddress": "02:42:ac:11:00:02",
                    "NetworkID": "7c18958daaa54d150a65532c5abed7d168e3b59a022742067f0db6ee5aadae15"
                }
            },
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null
        },
        "Snapshotter": {
            "Data": {
                "MergedDir": "/var/lib/pouch/containerd/state/io.containerd.runtime.v1.linux/default/9804f4bd92d86beff2a3e7a1549cab908ef702d7733227cbb67f07f4ab36d815/rootfs",
                "UpperDir": "/var/lib/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/35/fs"
            },
            "Name": "overlayfs"
        },
        "State": {
            "Error": "rpc error: code = Canceled desc = context canceled",
            "FinishedAt": "2018-06-06T01:38:34.201522382Z",
            "Pid": 16390,
            "StartedAt": "2018-06-06T01:51:30.696664334Z",
            "Status": "running"
        }
    }
]

Ⅱ. Describe what happened

Since the struct field has omitempty, so json umarshal can not show zero value . Like Cpu info and memory info which can not ne showed. It is a bug.

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • pouch version (use pouch version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@pouchrobot pouchrobot added the kind/bug This is bug report for project label Jun 8, 2018
@allencloud
Copy link
Collaborator

I think the key point is finding a way to generate a field which is not required but has no attribute of omitempty. Right? @HusterWan

cc @zhuangqh

@Letty5411
Copy link
Contributor

Letty5411 commented Jul 18, 2018

Compared with docker inspect, The following keys are still missing:
AppArmorProfile
AttachStderr
AttachStdin
AttachStdout
Domainname
FromCmdCreate
Labels
NetPriority
OpenStdin
StdinOnce
Tty
User
Volumes
WorkingDir
Driver
LowerDir
MergedDir
WorkDir
AutoRemove
Binds
BlkBufferWriteBps
BlkBufferWriteSwitch
BlkDeviceBufferWriteBps
BlkDeviceIdleTime
BlkDeviceLatencyTarget
BlkFileLevelSwitch
BlkFileThrottlePath
BlkMetaWriteTps
BlkioDeviceReadLowBps
BlkioDeviceReadLowIOps
BlkioDeviceWriteLowBps
BlkioDeviceWriteLowIOps
CPUBvtWarpNs
CapAdd
CapDrop
Cgroup
ConsoleSize
ContainerIDFile
CpuPeriod
CpuQuota
CpuShares
CpusetTrickCpus
CpusetTrickExemptTasks
CpusetTrickTasks
DiskQuota
Dns
DnsOptions
DnsSearch
ExtraHosts
GroupAdd
IntelRdtGroup
IntelRdtMba
IpcMode
Isolation
Links
Config
MemoryKillAll
MemoryPriority
MemoryUsePriorityOOM
NetCgroupCeil
NetCgroupRate
PidMode
PortBindings
Privileged
PublishAllPorts
ReadonlyRootfs
MaximumRetryCount
SecurityOpt
UTSMode
UsernsMode
VolumeDriver
VolumesFrom
HostRootPath
HostnamePath
HostsPath
LogPath
MountLabel
Bridge
EndpointID
Gateway
GlobalIPv6Address
GlobalIPv6PrefixLen
HairpinMode
IPAddress
IPPrefixLen
IPv6Gateway
LinkLocalIPv6Address
LinkLocalIPv6PrefixLen
MacAddress
EndpointID
Gateway
GlobalIPv6Address
GlobalIPv6PrefixLen
IPAMConfig
IPAddress
IPPrefixLen
IPv6Gateway
MacAddress
NetworkID
SkipResolver
Time
Ports
SandboxID
SandboxKey
Path
ProcessLabel
ResolvConfPath
RestartCount
Dead
Error
ExitCode
OOMKilled
Paused
Pid
Restarting
Running

@Ace-Tang
Copy link
Contributor Author

BlkBufferWriteBps
BlkBufferWriteSwitch
BlkDeviceBufferWriteBps
BlkDeviceIdleTime
BlkDeviceLatencyTarget
BlkFileLevelSwitch
BlkFileThrottlePath
BlkMetaWriteTps
BlkioDeviceReadLowBps
BlkioDeviceReadLowIOps
BlkioDeviceWriteLowBps
BlkioDeviceWriteLowIOps

this heys not need.

@zhuangqh
Copy link
Contributor

I create a proposal to cover this condition. go-swagger/go-swagger#1623
@Ace-Tang @allencloud

@allencloud
Copy link
Collaborator

Could we close this issue? @zhuangqh I would invite you to take a double check.
And please close this if it is proper.

@zhuangqh
Copy link
Contributor

already fixed in #2350 . closed @allencloud @Ace-Tang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants