Skip to content

Fix nerdctl load stdin for pipes. #1405

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

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

manugupt1
Copy link
Contributor

@manugupt1 manugupt1 commented Oct 2, 2022

Fixes #1404

@manugupt1 manugupt1 force-pushed the fix-stdin branch 3 times, most recently from a7f6f17 to 7f1a554 Compare October 3, 2022 00:05
@manugupt1 manugupt1 marked this pull request as ready for review October 3, 2022 00:33
@AkihiroSuda AkihiroSuda added this to the v0.23.1 milestone Oct 3, 2022
@manugupt1 manugupt1 force-pushed the fix-stdin branch 3 times, most recently from b4ea021 to d8c75dc Compare October 4, 2022 01:02
@@ -132,7 +132,7 @@ func loadImage(in io.Reader, cmd *cobra.Command, platMC platforms.MatchComparer,
if quiet {
fmt.Fprintln(cmd.OutOrStdout(), img.Target.Digest)
} else {
fmt.Fprintf(cmd.OutOrStdout(), "done\n")
fmt.Fprintf(cmd.OutOrStdout(), "Loaded image: %s", img.Name)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes the test docker compatible.

If stdin is received from a pipe, the size is still zero
and an error will not be not thrown now.

If stdin is empty, error will still be thrown.

Added tests

Signed-off-by: Manu Gupta <[email protected]>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 8d8e366 into containerd:master Oct 4, 2022
@manugupt1 manugupt1 deleted the fix-stdin branch October 6, 2022 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"nerdctl load" can't read data from stdin
3 participants