Files
kata-containers/tools/packaging
Greg Kurz a779e19bee tools/packaging: Fix error path in 'kata-deploy-binaries.sh -s'
`make kata-tarball` relies on `kata-deploy-binaries.sh -s` which
silently ignores errors, and you may end up with an incomplete
tarball without noticing it because `make`'s exit status is 0.

`kata-deploy-binaries.sh` does set the `errexit` option and all the
code in the script seems to assume that since it doesn't do error
checking. Unfortunately, bash automatically disables `errexit` when
calling a function from a conditional pipeline, like done in the `-s`
case:

	if [ "${silent}" == true ]; then
		if ! handle_build "${t}" &>"$log_file"; then
                ^^^^^^
           this disables `errexit`

and `handle_build` ends with a `tar tvf` that always succeeds.

Adding error checking all over the place isn't really an option
as it would seriously obfuscate the code. Drop the conditional
pipeline instead and print the final error message from a `trap`
handler on the special ERR signal. This requires the `errtrace`
option as `trap`s aren't propagated to functions by default.

Since all outputs of `handle_build` are redirected to the build
log file, some file descriptor duplication magic is needed for
the handler to be able to write to the orignal stdout and stderr.

Fixes #3757

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-29 19:00:46 +02:00
..
2022-03-16 10:35:39 -06:00
2022-03-16 10:35:39 -06:00
2022-01-20 18:00:58 +00:00
2022-01-20 18:00:58 +00:00

Kata Containers packaging

Introduction

Kata Containers currently supports packages for many distributions. Tooling to aid in creating these packages are contained within this repository.

Build in a container

Kata build artifacts are available within a container image, created by a Dockerfile. Reference DaemonSets are provided in kata-deploy, which make installation of Kata Containers in a running Kubernetes Cluster very straightforward.

Build a snap package

See the snap documentation.

Build static binaries

See the static build documentation.

Build Kata Containers Kernel

See the kernel documentation.

Build QEMU

See the QEMU documentation.

Create a Kata Containers release

See the release documentation.

Packaging scripts

See the scripts documentation.

Credits

Kata Containers packaging uses packagecloud for package hosting.