-
Notifications
You must be signed in to change notification settings - Fork 460
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
crictl inspecti does not print valid JSON when multiple image IDs provided #669
Comments
A possible workaround could be replacing the output using regex |
Yeah, the same issue exists for |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I feel this will hardly be prioritized. /close |
I'm running into this issue as well. When querying 100's of images on a host it's more efficient to do one shell command than 100's. Hopefully we can get an option to turn pretty-print off. |
Approaching a fix in #1493 |
What happened:
I ran
crictl inspecti -o json <id1> <id2>
, and this output two JSON chunks instead of valid JSON array. The result makes using other tools to process output very hard.What you expected to happen:
A valid JSON array containing two dictionaries.
How to reproduce it (as minimally and precisely as possible):
Run
crictl inspecti -o json <id1> <id2>
and examine the output.Anything else we need to know?:
I guess the reason is that printing is done per image https://github.com/kubernetes-sigs/cri-tools/blob/master/cmd/crictl/image.go#L267, instead of composing a full JSON.
The same goes to YAML output as well.
So I think we can either output a complete JSON or have an option to output a single line json without pretty print. As for YAML, the only optional I think is to output multiple YAML doc separated by
---
Environment:
cat /etc/os-release
): GKE containerd imageuname -a
): Linux 4.19.112+ Add e2e test framework and basic test cases. #1 SMP Fri Sep 4 12:00:04 PDT 2020 x86_64 Intel(R) Xeon(R) CPU @ 2.30GHz GenuineIntel GNU/LinuxThe text was updated successfully, but these errors were encountered: