mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-04-26 18:43:06 +00:00
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:
committed by
Fabiano Fidêncio
parent
614cd0618e
commit
8ed4fa1406
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user