runtime-rs: Add RUNTIME_ALLOW_MOUNTS to RuntimeInfo

Add RUNTIME_ALLOW_MOUNTS annotation to RuntimeInfo to specify
custom mount types allowed by the runtime.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
Alex Lyn
2026-03-31 17:16:39 +08:00
committed by Fabiano Fidêncio
parent 614cd0618e
commit 8ed4fa1406

View File

@@ -26,6 +26,10 @@ use shim::{config, Args, Error, ShimExecutor};
const DEFAULT_TOKIO_RUNTIME_WORKER_THREADS: usize = 2;
// env to config tokio runtime worker threads
const ENV_TOKIO_RUNTIME_WORKER_THREADS: &str = "TOKIO_RUNTIME_WORKER_THREADS";
// RUNTIME_ALLOW_MOUNTS are the custom mount types allowed by the runtime. These
// types should not be handled by the mount manager.
// To include prepare mount types, use "/*" suffix, such as "format/*"
pub const RUNTIME_ALLOW_MOUNTS: &str = "containerd.io/runtime-allow-mounts";
#[derive(Debug)]
enum Action {
@@ -134,6 +138,10 @@ fn show_info() -> Result<()> {
let mut info = RuntimeInfo::new();
info.name = config::CONTAINERD_RUNTIME_NAME.to_string();
info.version = Some(version).into();
info.annotations.insert(
RUNTIME_ALLOW_MOUNTS.to_string(),
"mkdir/*,format/*,erofs".to_string(),
);
let data = info
.write_to_bytes()