Skip to content

Commit

Permalink
Merge pull request kata-containers#10755 from fidencio/topic/ensure-s…
Browse files Browse the repository at this point in the history
…ystemd-is-used-as-init-for-coco-cases

rootfs-confidential: Ensure systemd is used as init
  • Loading branch information
fidencio authored Jan 23, 2025
2 parents a23d6a1 + 734ef71 commit 66d881a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/integration/kubernetes/k8s-confidential.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setup() {

coco_enabled=""
for i in {1..6}; do
rm -f "${HOME}/.ssh/known_hosts"
if ! pod_ip=$(kubectl get pod -o wide | grep "confidential-unencrypted" | awk '{print $6;}'); then
warn "Failed to get pod IP address."
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
app: "confidential-unencrypted"
template:
metadata:
annotations:
io.katacontainers.config.hypervisor.kernel_params: "log_buf_len=4M"
labels:
app: "confidential-unencrypted"
spec:
Expand Down
2 changes: 1 addition & 1 deletion tools/packaging/guest-image/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ build_initrd() {
ROOTFS_BUILD_DEST="${builddir}/initrd-image" \
USE_DOCKER=1 \
AGENT_TARBALL="${AGENT_TARBALL}" \
AGENT_INIT="yes" \
AGENT_INIT="${AGENT_INIT:-no}" \
AGENT_POLICY="${AGENT_POLICY:-}" \
PULL_TYPE="${PULL_TYPE:-default}" \
COCO_GUEST_COMPONENTS_TARBALL="${COCO_GUEST_COMPONENTS_TARBALL:-}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ SHIM_V2_CONTAINER_BUILDER="${SHIM_V2_CONTAINER_BUILDER:-}"
TDSHIM_CONTAINER_BUILDER="${TDSHIM_CONTAINER_BUILDER:-}"
TOOLS_CONTAINER_BUILDER="${TOOLS_CONTAINER_BUILDER:-}"
VIRTIOFSD_CONTAINER_BUILDER="${VIRTIOFSD_CONTAINER_BUILDER:-}"
AGENT_INIT="${AGENT_INIT:-no}"
MEASURED_ROOTFS="${MEASURED_ROOTFS:-}"
PULL_TYPE="${PULL_TYPE:-default}"
USE_CACHE="${USE_CACHE:-}"
Expand Down Expand Up @@ -128,6 +129,7 @@ docker run \
--env TDSHIM_CONTAINER_BUILDER="${TDSHIM_CONTAINER_BUILDER}" \
--env TOOLS_CONTAINER_BUILDER="${TOOLS_CONTAINER_BUILDER}" \
--env VIRTIOFSD_CONTAINER_BUILDER="${VIRTIOFSD_CONTAINER_BUILDER}" \
--env AGENT_INIT="${AGENT_INIT}" \
--env MEASURED_ROOTFS="${MEASURED_ROOTFS}" \
--env PULL_TYPE="${PULL_TYPE}" \
--env USE_CACHE="${USE_CACHE}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,12 @@ install_initrd() {
export PAUSE_IMAGE_TARBALL="$(get_pause_image_tarball_path)"
fi
else
# No variant is passed, it means vanilla kata containers
os_name="$(get_from_kata_deps ".assets.initrd.architecture.${ARCH}.name")"
os_version="$(get_from_kata_deps ".assets.initrd.architecture.${ARCH}.version")"
if [ "${os_name}" = "alpine" ]; then
export AGENT_INIT=yes
fi
fi

export AGENT_TARBALL=$(get_agent_tarball_path)
Expand Down

0 comments on commit 66d881a

Please sign in to comment.