Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current `Convert` implementation has the following interface: ``` Convert(ctx context.Context, dest io.Writer, opt ConvertOption) (src io.WriteCloser, err error) ``` The caller writes the OCI tar stream to src and Convert converts src to a nydus tar stream and writes it to dest. The current implementation must wait for the OCI tar stream to be unpacked into a directory before calling the builder (nydus-image) to start the build, which takes advantage of `pr, pw := io.Pipe()`. Before this commit, the `unpackOciTar` method did not fully read the OCI tarball when `pw.Close()` was called, which means that the build is started before the unpacking is complete, which may result in some files being missing from the nydus image. Fixup: use a channel to wait for the unpack to complete. Signed-off-by: Yan Song <[email protected]>
- Loading branch information