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

bugfix: make inspect output an array #1119

Merged

Conversation

faycheng
Copy link
Contributor

Signed-off-by: 程飞 [email protected]

Ⅰ. Describe what this PR did

make inspect output an array

Ⅱ. Does this pull request fix one issue?

fixes: #1071

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XL labels Apr 12, 2018
@faycheng faycheng force-pushed the fix-multi-inspect branch from 9b7b41f to 12ebcac Compare April 12, 2018 07:36
@codecov-io
Copy link

Codecov Report

Merging #1119 into master will decrease coverage by 0.06%.
The diff coverage is 15.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1119      +/-   ##
==========================================
- Coverage   16.66%   16.59%   -0.07%     
==========================================
  Files         165      165              
  Lines        8911     8894      -17     
==========================================
- Hits         1485     1476       -9     
+ Misses       7321     7313       -8     
  Partials      105      105
Impacted Files Coverage Δ
pkg/utils/utils.go 78.75% <ø> (+0.59%) ⬆️
cli/network.go 0% <0%> (ø) ⬆️
cli/image_inspect.go 0% <0%> (ø) ⬆️
cli/inspect.go 0% <0%> (ø) ⬆️
cli/volume.go 8.19% <0%> (ø) ⬆️
cli/inspect/inspector.go 73.13% <58.33%> (+19.61%) ⬆️
pkg/kernel/kernel.go 72.72% <0%> (-7.28%) ⬇️
client/client.go 33.33% <0%> (-3.04%) ⬇️
cli/command.go 0% <0%> (ø) ⬆️
... and 1 more

@allencloud
Copy link
Collaborator

I tested on my local machine with this pull request, and it works perfect:

root@ubuntu:~/go/src/github.com/alibaba/pouch# git fetch upstream pull/1119/head:new-1119; git checkout new-1119; make install
remote: Counting objects: 60, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 60 (delta 43), reused 52 (delta 43), pack-reused 7
Unpacking objects: 100% (60/60), done.
From https://github.com/alibaba/pouch
 * [new ref]         refs/pull/1119/head -> new-1119
Switched to branch 'new-1119'
GOOS=linux go build -o pouchd
go build -o pouch github.com/alibaba/pouch/cli
install
installing pouchd and pouch to /usr/local/bin
root@ubuntu:~/go/src/github.com/alibaba/pouch# pouch run -d d623b3e174aa sleep 10000
81757e960e76ce6e040d2be12130a2e2dbefb265c553227c839a2da1037447db
root@ubuntu:~/go/src/github.com/alibaba/pouch# pouch run -d d623b3e174aa sleep 10000
a5648fd8df7343d80357d4bdc211f7701e265630114072894005096e7dbe6fb5
root@ubuntu:~/go/src/github.com/alibaba/pouch# pouch ps
Name     ID       Status         Created         Image                                          Runtime
a5648f   a5648f   Up 3 seconds   3 seconds ago   registry.hub.docker.com/library/ubuntu:16.04   runc
81757e   81757e   Up 6 seconds   6 seconds ago   registry.hub.docker.com/library/ubuntu:16.04   runc
d6189c   d6189c   Up 2 hours     2 hours ago     registry.hub.docker.com/library/ubuntu:16.04   runc
1f4ebb   1f4ebb   Up 2 days      2 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
417113   417113   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
1fa4b6   1fa4b6   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
a334a2   a334a2   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
bfd95c   bfd95c   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
830fbd   830fbd   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
8f6a65   8f6a65   Up 3 days      3 days ago      registry.hub.docker.com/library/ubuntu:16.04   runc
root@ubuntu:~/go/src/github.com/alibaba/pouch# pouch inspect 81757e 8f6a65
[
    {
        "Args": null,
        "Config": {
            "Cmd": [
                "sleep",
                "10000"
            ],
            "Entrypoint": null,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Image": "registry.hub.docker.com/library/ubuntu:16.04",
            "OnBuild": null,
            "Shell": null
        },
        "Created": "2018-04-12T08:12:01.66826797Z",
        "GraphDriver": {
            "Data": {
                "BaseFS": "/var/lib/pouch/containerd/state/io.containerd.runtime.v1.linux/default/81757e960e76ce6e040d2be12130a2e2dbefb265c553227c839a2da1037447db/rootfs"
            },
            "Name": "overlay2"
        },
        "HostConfig": {
            "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": "81757e960e76ce6e040d2be12130a2e2dbefb265c553227c839a2da1037447db",
        "Image": "registry.hub.docker.com/library/ubuntu:16.04",
        "Mounts": [],
        "Name": "81757e",
        "NetworkSettings": {
            "Networks": {
                "bridge": {
                    "Aliases": null,
                    "EndpointID": "1f8a8a0b3acf22608eb9ccb4a38707ede641cdf909957757d08be1f7f3e784fc",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2/24",
                    "IPPrefixLen": 24,
                    "Links": null,
                    "MacAddress": "02:42:ac:11:00:02",
                    "NetworkID": "be34eaaa507ecb5e840946ec25040ba9840d30d22e7bd942ed23b7b11eae7922"
                }
            },
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null
        },
        "State": {
            "Pid": 10822,
            "StartedAt": "2018-04-12T08:12:01.916719526Z",
            "Status": "running"
        }
    },
    {
        "Args": null,
        "Config": {
            "Cmd": [
                "sleep",
                "100000"
            ],
            "Entrypoint": null,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Image": "registry.hub.docker.com/library/ubuntu:16.04",
            "OnBuild": null,
            "Shell": null
        },
        "Created": "2018-04-08T09:54:16.105924964Z",
        "GraphDriver": {
            "Data": {
                "BaseFS": "/var/lib/pouch/containerd/state/io.containerd.runtime.v1.linux/default/8f6a65be5070103c6c109010d570ff6b5993300973dbbf1647bc1cf93fb8d8c7/rootfs"
            },
            "Name": "overlay2"
        },
        "HostConfig": {
            "NetworkMode": "bridge",
            "OomScoreAdj": -500,
            "RestartPolicy": {
                "Name": "no"
            },
            "Runtime": "runc",
            "BlkioDeviceReadBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceWriteIOps": null,
            "BlkioWeightDevice": null,
            "CgroupParent": "default",
            "CpuPeriod": 1000,
            "CpuQuota": 1000,
            "DeviceCgroupRules": null,
            "Devices": [],
            "MemoryExtra": 0,
            "MemorySwappiness": -1,
            "MemoryWmarkRatio": 0,
            "OomKillDisable": false,
            "Ulimits": null
        },
        "Id": "8f6a65be5070103c6c109010d570ff6b5993300973dbbf1647bc1cf93fb8d8c7",
        "Image": "registry.hub.docker.com/library/ubuntu:16.04",
        "Mounts": [],
        "Name": "8f6a65",
        "NetworkSettings": {
            "Networks": {
                "bridge": {
                    "Aliases": null,
                    "EndpointID": "36261e10a9699566fed0dfa4a0eaeca1d232e0d13d35b0f457433c240d727875",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2/24",
                    "IPPrefixLen": 24,
                    "Links": null,
                    "MacAddress": "02:42:ac:11:00:02",
                    "NetworkID": "bc81e097067a77fd4fb2f1111661807e8ee486d138b90e22fb1f692dfb4668d7"
                }
            },
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null
        },
        "State": {
            "Pid": 5090,
            "StartedAt": "2018-04-08T09:54:16.390200647Z",
            "Status": "running"
        }
    }
]
root@ubuntu:~/go/src/github.com/alibaba/pouch#

Let us move to code review.

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 12, 2018
@allencloud allencloud merged commit 7d6ebe7 into AliyunContainerService:master Apr 12, 2018
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 LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] command pouch inspect does not output an array
4 participants