From ad5ef2c89e5bc577396b3740571d43d3f411e0ea Mon Sep 17 00:00:00 2001 From: yihuaf Date: Sun, 20 Aug 2023 09:35:50 -0700 Subject: [PATCH] Add a comment explaining when the validate step runs. Signed-off-by: yihuaf --- crates/libcontainer/src/workload/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/libcontainer/src/workload/mod.rs b/crates/libcontainer/src/workload/mod.rs index 2e522ed2f..fb71334d2 100644 --- a/crates/libcontainer/src/workload/mod.rs +++ b/crates/libcontainer/src/workload/mod.rs @@ -47,6 +47,10 @@ pub trait Executor: CloneBoxExecutor { /// Executes the workload fn exec(&self, spec: &Spec) -> Result<(), ExecutorError>; + /// Validate if the spec can be executed by the executor. This step runs + /// after the container init process is created, entered into the correct + /// namespace and cgroups, and pivot_root into the rootfs. But this step + /// runs before waiting for the container start signal. fn validate(&self, spec: &Spec) -> Result<(), ExecutorError>; }