mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
tests: Build Mariner rootfs initrd
* Adds a new `rootfs-initrd-mariner` build target. * Sets the custom initrd path via annotation in `setup.sh` at test time. * Adapts versions.yaml to specify a `cbl-mariner` initrd variant. * Introduces env variable `HOST_OS` at deploy time to enable using a custom initrd. * Refactors the image builder so that its caller specifies the desired guest OS. Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
@@ -8,13 +8,23 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
kubernetes_dir=$(dirname "$(readlink -f "$0")")
|
||||
repo_root_dir="$(cd "${kubernetes_dir}/../../../" && pwd)"
|
||||
|
||||
set_runtime_class() {
|
||||
sed -i -e "s|runtimeClassName: kata|runtimeClassName: kata-${KATA_HYPERVISOR}|" ${kubernetes_dir}/runtimeclass_workloads/*.yaml
|
||||
}
|
||||
|
||||
set_initrd_path() {
|
||||
if [[ "${KATA_HOST_OS}" = "cbl-mariner" ]]; then
|
||||
initrd_path="/opt/kata/share/kata-containers/kata-containers-initrd-cbl-mariner.img"
|
||||
find ${kubernetes_dir}/runtimeclass_workloads/*.yaml -exec yq write -i {} 'metadata.annotations[io.katacontainers.config.hypervisor.initrd]' "${initrd_path}" \;
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
INSTALL_IN_GOPATH=false bash "${repo_root_dir}/ci/install_yq.sh"
|
||||
set_runtime_class
|
||||
set_initrd_path
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
Reference in New Issue
Block a user