-
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
adding verbose debug output for inspect & inspects #206
Conversation
5ff2724
to
5016f72
Compare
Take a look at https://github.com/kubernetes-incubator/cri-tools/blob/master/cmd/crictl/info.go |
It does.. |
@@ -221,6 +221,10 @@ var containerStatusCommand = cli.Command{ | |||
Name: "output, o", | |||
Usage: "Output format, One of: json|yaml|table", | |||
}, | |||
cli.BoolFlag{ |
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.
I think for inspect, we should always set verbose=true
in crictl.
verbose=false
is for kubelet using CRI.
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.
@Random-Liu so you are saying you want a --quiet option for less verbose? or take out the option all-together? There were already other verbose flags so I figured that's what we would want with this verbose option.
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.
I feel like by default we should enable verbose, or else it's really troublesome to do -v every time. :)
As for whether we need a quiet
option, I'm not sure.
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.
@Random-Liu I hear ya.. think it over no rush, easy enough to switch it to verbose by default, or quiet mode option. But I think when you see the verbose mode from the CRI-O team you'll be begging to turn down the volume :-) @runcom
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.
? Not following, what about CRI-O? We aren't even using that verbose stuff and we have no plan to output anything.
In any case, I'm in favor of going verbose by default like Lantao
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.
+1 of enabling verbose.
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.
I was just making light of the amount of metadata CRI-O keeps around that could possibly used in a verbose output of status about the container, thus the smiley face :-)
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.
Yeah but that's exactly the verbose intention, despite what runtimes want to output
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.
I vote inspect to be verbose by default for crictl (and provide a silent flag to turn verbose off).
I vote to make the json format the default (and I don't care if you want to kill the table format or keep it as an option).
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..
@@ -221,6 +221,10 @@ var containerStatusCommand = cli.Command{ | |||
Name: "output, o", | |||
Usage: "Output format, One of: json|yaml|table", |
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.
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.
I'm not a big fan of table, let's drop it in favor of machine readable output
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.
I'm not a big fan of table formats either, but as @Random-Liu says the unix timestamp is not human readable output:
crictl --runtime-endpoint /var/run/cri-containerd.sock inspect -v -o json 44025055b48da66cb67bfc221f800fe50f1256d3e22f1cf714294344b29d582e
{
"status": {
"id": "44025055b48da66cb67bfc221f800fe50f1256d3e22f1cf714294344b29d582e",
"metadata": {
"name": "busybox",
"attempt": 0
},
"state": "CONTAINER_CREATED",
"createdAt": "1511994785429097447",
"startedAt": "0",
"finishedAt": "0",
"exitCode": 0,
"image": {
"image": "docker.io/library/busybox:latest"
},
"imageRef": "docker.io/library/busybox@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0",
"reason": "",
"message": "",
"logPath": ""
},
vs:
crictl --runtime-endpoint /var/run/cri-containerd.sock inspect -v 44025055b48da66cb67bfc221f800fe50f1256d3e22f1cf714294344b29d582e
ID: 44025055b48da66cb67bfc221f800fe50f1256d3e22f1cf714294344b29d582e
Name: busybox
State: CONTAINER_CREATED
Created: 28 minutes ago
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.
We can do some conversion there, not a big deal
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.
Yeah, we should do some conversion. :)
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.
Agreed, table is not useful for inspect.
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.
so.. @Random-Liu @runcom @feiskyer wrt. "some conversion"
I suggest converting the timestamps to RFC3339Nano
"2006-01-02T15:04:05.999999999Z07:00"
Thoughts?
Signed-off-by: Mike Brown <[email protected]>
5016f72
to
faa6682
Compare
Ok I've changed inspect to use json format by default, made the default output verbose, and introduced a quiet flag just because. @Random-Liu @runcom @feiskyer |
Signed-off-by: Mike Brown <[email protected]>
I've added a new commit for the inspects (sandbox inspect) changes. |
/lgtm I think we don't need the table output, but let's keep it for now in case that someone may like it. |
Signed-off-by: Mike Brown <[email protected]>
See kubernetes/kubernetes#53965
Changes inspect (container) and inspects (sandbox) to be verbose by default, and using json format by default per discussion below.
Verbose is a new option for the subject status requests afforded by the CRI api.
I've also added "quiet" options to the these two inspect(s) in case someone does not want verbose, and to otherwise exercise the non verbose status requests.
Signed-off-by: Mike Brown [email protected]