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

Add image tag used by container for crictl ps and add attempt for crictl ps/sandboxes #187

Merged

Conversation

miaoyq
Copy link
Contributor

@miaoyq miaoyq commented Nov 7, 2017

Fixes #184 #185

/assign @Random-Liu

Signed-off-by: Yanqiang Miao miao.yanqiang@zte.com.cn

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 7, 2017
@miaoyq miaoyq force-pushed the add-image-tag-for-crictl-ps branch from 5515c25 to d2267f3 Compare November 7, 2017 14:23
@miaoyq miaoyq changed the title Add image tag used by container for crictl ps Add image tag used by container for crictl ps and add attempt for crictl ps/sandboxes Nov 7, 2017
@@ -592,3 +594,12 @@ func ListContainers(client pb.RuntimeServiceClient, opts listOptions) error {
w.Flush()
return nil
}

func getImageRef(c *pb.Container) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in current CRI implementation c.Image.Image should mostly be image tag, I don't think you want to truncate it.
See:

I think we could show the c.Image.Image directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Random-Liu
Copy link
Contributor

LGTM overall, please paste the output, rebase and address comments.

@miaoyq miaoyq force-pushed the add-image-tag-for-crictl-ps branch from d2267f3 to 7c47d05 Compare November 8, 2017 06:50
@miaoyq
Copy link
Contributor Author

miaoyq commented Nov 8, 2017

@Random-Liu Updated.
The output:

# crictl ps
CONTAINER ID        IMAGE                                                                                                               CREATED             STATE               NAME                ATTEMPT
d67cc2866acff       gcr.io/google_containers/kube-proxy-amd64@sha256:58fd496116bf3d2790279f9c44040bdfa71791aba7a7a1b5ca35025b5a032b9f   2 weeks ago         CONTAINER_RUNNING   kube-proxy          0
d7991a3ccae38       docker.io/library/busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7                   About an hour ago   CONTAINER_EXITED    busybox             147
757fc432b9e10       docker.io/library/busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7                   About an hour ago   CONTAINER_EXITED    busybox             280
c87e53334fc9b       docker.io/library/busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7                   23 minutes ago      CONTAINER_RUNNING   busybox             148
e3e809d23abaf       docker.io/library/busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7                   20 minutes ago      CONTAINER_RUNNING   busybox             281
# crictl sandboxes
SANDBOX ID          CREATED             STATE               NAME                NAMESPACE           ATTEMPT
41555a4bd665d       11 days ago         SANDBOX_READY       busybox             default             0
cce6f4f601d44       2 weeks ago         SANDBOX_READY       kube-proxy-gwb2k    kube-system         0
432374d9dfa61       6 days ago          SANDBOX_READY       busybox             myq                 0

…crictl ps/sandboxes`

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
@Random-Liu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2017
@Random-Liu Random-Liu merged commit b129c40 into kubernetes-sigs:master Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants