Skip to content

fix(context): finish tar before closing export pipe - #7341

Open
tayfuryldz wants to merge 1 commit into
docker:masterfrom
tayfuryldz:fix/7332-context-export-tar
Open

tayfuryldz wants to merge 1 commit into
docker:masterfrom
tayfuryldz:fix/7332-context-export-tar

Conversation

@tayfuryldz

Copy link
Copy Markdown

Fixes #7332.

Close the tar writer before closing the pipe used by context export. This lets archive/tar write the final file padding and end-of-archive records instead of attempting those writes after the pipe has already been closed.

The regression test uses TLS data with a non-block-aligned size and checks that the exported stream is block-aligned and ends with the two tar zero blocks.

I also reproduced the close-order behavior with the standard library in isolation: the old order produced a 513-byte truncated stream for a one-byte entry, while closing the tar writer first produced a complete 2048-byte stream.

The repository unit target cannot run directly in this checkout without its development container/dependency environment, so I have not represented it as a local pass.

Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
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.

docker context export writes a truncated tar archive

1 participant