Documentation
¶
Overview ¶
Package pack contains the atomic-write helper shared by every component that emits a tar artifact into the user's bundle directory (platform, installer, security, per-module). Centralizing the staging/rename/cleanup logic here makes it impossible for one of those components to forget the pattern and accidentally leave a half-written or empty tar behind after a failed or cancelled pull - which is what produced the empty (~5 KiB) module-*.tar files that survived an interrupted mirror pull.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
func Bundle( ctx context.Context, bundleDir, pkgName string, bundleChunkSize int64, pack func(io.Writer) error, ) error
Bundle stages the result of pack into a temporary file (or a set of temporary chunk files when bundleChunkSize > 0) and only promotes it to its final name on success. On any error - including ctx cancellation - the staged files are deleted so the bundle directory never contains stub artifacts for downloads that did not actually complete.
pack must write the full tar payload to the io.Writer; it must not retain the writer past return.
Types ¶
This section is empty.