-
Notifications
You must be signed in to change notification settings - Fork 456
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
Support using sandbox name for sandbox operating #174
Support using sandbox name for sandbox operating #174
Conversation
b7a07c9
to
f1cf2a7
Compare
|
@Random-Liu Will do.
Sandbox name is the value of |
We also have podSandbox.Metadata.Attempt. There may be multiple sandboxes with the same name, that's how CRI works. :) |
@Random-Liu Thanks for explaining, I think I should take more time to study this part in k8s. |
ee19f89
to
c4eb72f
Compare
# crictl sandboxes
SANDBOX ID NAME NAMESPACE STATE
41555a4bd665d busybox default SANDBOX_READY
cce6f4f601d44 kube-proxy-gwb2k kube-system SANDBOX_READY
432374d9dfa61 busybox myq SANDBOX_READY
# crictl sandboxes --name busybox
SANDBOX ID NAME NAMESPACE STATE
41555a4bd665d busybox default SANDBOX_READY
432374d9dfa61 busybox myq SANDBOX_READY
# crictl sandboxes --namespace myq
SANDBOX ID NAME NAMESPACE STATE
432374d9dfa61 busybox myq SANDBOX_READY
# crictl sandboxes --name busybox --namespace myq
SANDBOX ID NAME NAMESPACE STATE
432374d9dfa61 busybox myq SANDBOX_READY # crictl ps
CONTAINER ID CREATED STATE NAME
d67cc2866acff 2 weeks ago CONTAINER_RUNNING kube-proxy
ddad3288bced9 2 hours ago CONTAINER_EXITED busybox
44adf44fe7013 About an hour ago CONTAINER_EXITED busybox
b9a62c3560e06 About an hour ago CONTAINER_RUNNING busybox
6a89881280e61 7 seconds ago CONTAINER_RUNNING busybox |
We may want to add a flag to show |
cmd/crictl/sandbox.go
Outdated
@@ -357,15 +373,16 @@ func ListPodSandboxes(client pb.RuntimeServiceClient, opts listOptions) error { | |||
|
|||
w := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0) | |||
if !opts.verbose && !opts.quiet { | |||
fmt.Fprintln(w, "SANDBOX ID\tNAME\tSTATE") | |||
fmt.Fprintln(w, "SANDBOX ID\tNAME\tNAMESPACE\tSTATE") |
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.
Sorry, I found that for containers we put name at the end. Let's keep this consitent.
Let's do the same sandbox id\tstate\tname\tnamespace
.
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.
Done.
LGTM with one last nit. |
c4eb72f
to
59108b5
Compare
Signed-off-by: Yanqiang Miao <[email protected]>
/lgtm |
/retest |
@Random-Liu The Could you help to trigger the test again? |
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.
CI green now, LGTM
namespace
intable
format output ofcrictl sandboxes
inspects
,stops
andrms
.Example:
Show
namespace
:# crictl sandboxes SANDBOX ID NAME STATE NAMESPACE 432374d9dfa61d8768668784e9d5392159c8b87810628fefe2871b9233ff0187 busybox SANDBOX_READY myq 41555a4bd665dd92078701eb8cbd84723c9257825b1219240de3292343316e3f busybox SANDBOX_READY default cce6f4f601d4494f9ea2aba48c36b70fea107d9e047e8916052348a128ad51e2 kube-proxy-gwb2k SANDBOX_READY kube-system
Get the status of a sandbox by sandbox name:
Get the status of a sandbox by sandbox ID:
/cc @feiskyer @Random-Liu
Signed-off-by: Yanqiang Miao [email protected]