-
Notifications
You must be signed in to change notification settings - Fork 693
fix: inspect should return one array rather than a stream of array #3961
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
Conversation
Thanks, can we have a test? |
Sure, i will add a test. |
@weiyuhang2011 Ping! Did you find time to write tests? Thank you! |
Indeed, it's been delayed for quite a while... I've prepared an initial draft and will strive to complete it this week. |
3ce4a1a
to
36c24b5
Compare
I do personally like that we would be moving presentation concerns into That being said, this is personal opinion, and I am not sure if this was discussed before and/or if there was agreement on this. |
} | ||
|
||
// Display | ||
if len(entries) > 0 { |
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.
Is this necessary?
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 we can keep it, but remove the one in cmd/nerdctl/inspect/inspect.go
} | ||
|
||
// Display | ||
if len(entries) > 0 { |
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.
Same question as above.
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.
same
Two main comments:
Plus a nit inside test. Otherwise LGTM. |
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.
LGTM
Signed-off-by: Yuhang Wei <weiyuhang2011@gmail.com>
`nerdctl inspect <container> <image>` should return a single JSON array containing both the container and image inspect results. This unit test parses the output and compares it with the results of separate `inspect` commands to ensure correctness. Signed-off-by: Yuhang Wei <weiyuhang2011@gmail.com>
36c24b5
to
a46b567
Compare
It seems like the CI is failing on some tests not relevant to this PR? |
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.
Thanks
Next time please consider squashing the commits
Description
This PR fixes an issue where
nerdctl inspect <container1> <image1>
return a stream of array rather than one array.Steps to reproduce the issue
current
fixed
Fix: #3006