From f65cfe302ab96fc43f4e0bb40d160df0c05cfda9 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Thu, 9 Apr 2026 15:47:22 +0800 Subject: [PATCH] kata-deploy: Complete containerd config for erofs snapshotter Add missing containerd configuration items for erofs snapshotter to enable fsmerged erofs feature: - Add differ plugin configuration: - mkfs_options: ["-T0","--mkfs-time","--sort=none"] - enable_tar_index: false - Add snapshotter plugin configuration: - default_size: "10G" - max_unmerged_layers: 1 These configurations align with the documentation in docs/how-to/how-to-use-fsmerged-erofs-with-kata.md Step 2, ensuring the CI workflow run-k8s-tests-coco-nontee-with-erofs-snapshotter can properly configure containerd for erofs fsmerged rootfs. Signed-off-by: Alex Lyn --- .../binary/src/artifacts/snapshotters.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/packaging/kata-deploy/binary/src/artifacts/snapshotters.rs b/tools/packaging/kata-deploy/binary/src/artifacts/snapshotters.rs index fb49f35d5a..5970eca085 100644 --- a/tools/packaging/kata-deploy/binary/src/artifacts/snapshotters.rs +++ b/tools/packaging/kata-deploy/binary/src/artifacts/snapshotters.rs @@ -30,6 +30,20 @@ pub async fn configure_erofs_snapshotter( "[\"erofs\",\"walking\"]", )?; + //// Configure erofs differ plugin + //// erofs-utils >= 1.8.2 + //toml_utils::set_toml_value( + // configuration_file, + // ".plugins.\"io.containerd.differ.v1.erofs\".mkfs_options", + // "[\"-T0\",\"--mkfs-time\",\"--sort=none\"]", + //)?; + toml_utils::set_toml_value( + configuration_file, + ".plugins.\"io.containerd.differ.v1.erofs\".enable_tar_index", + "false", + )?; + + // Configure erofs snapshotter plugin toml_utils::set_toml_value( configuration_file, ".plugins.\"io.containerd.snapshotter.v1.erofs\".enable_fsverity", @@ -40,6 +54,16 @@ pub async fn configure_erofs_snapshotter( ".plugins.\"io.containerd.snapshotter.v1.erofs\".set_immutable", "true", )?; + toml_utils::set_toml_value( + configuration_file, + ".plugins.\"io.containerd.snapshotter.v1.erofs\".default_size", + "\"10G\"", + )?; + toml_utils::set_toml_value( + configuration_file, + ".plugins.\"io.containerd.snapshotter.v1.erofs\".max_unmerged_layers", + "1", + )?; Ok(()) }