-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add image tag used by container for crictl ps
and add attempt for crictl ps/sandboxes
#187
Conversation
5515c25
to
d2267f3
Compare
crictl ps
crictl ps
and add attempt for crictl ps/sandboxes
cmd/crictl/container.go
Outdated
@@ -592,3 +594,12 @@ func ListContainers(client pb.RuntimeServiceClient, opts listOptions) error { | |||
w.Flush() | |||
return nil | |||
} | |||
|
|||
func getImageRef(c *pb.Container) string { |
There was a problem hiding this comment.
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:
- https://github.com/kubernetes-incubator/cri-containerd/blob/master/pkg/server/container_status.go#L49
- https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockershim/docker_container.go#L375
I think we could show the c.Image.Image
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still show c.Image.Image
directly if c.Image.Image
is imageID?
LGTM overall, please paste the output, rebase and address comments. |
d2267f3
to
7c47d05
Compare
@Random-Liu Updated. # 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>
/lgtm |
Fixes #184 #185
/assign @Random-Liu
Signed-off-by: Yanqiang Miao miao.yanqiang@zte.com.cn