Skip to content

Commit

Permalink
Merge pull request #60 from rumpl/prestart_hooks
Browse files Browse the repository at this point in the history
Move call of the prestart hooks over to the lib part
  • Loading branch information
cpuguy83 authored Feb 2, 2023
2 parents bdf09c6 + b935808 commit ec19a08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions crates/containerd-shim-wasm/src/sandbox/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,10 @@ where

debug!("create done");

// Per the spec, the prestart hook must be called as part of the create operation
debug!("call prehook before the start");
oci::setup_prestart_hooks(&spec.hooks())?;

Ok(api::CreateTaskResponse {
pid: std::process::id(),
..Default::default()
Expand Down
3 changes: 0 additions & 3 deletions crates/wasmedge/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ impl Instance for Wasi {
debug!("preparing module");
let spec = load_spec(self.bundle.clone())?;

debug!("call prehook before the start");
oci::setup_prestart_hooks(spec.hooks())?;

let vm = prepare_module(engine, &spec, stdin, stdout, stderr)
.map_err(|e| Error::Others(format!("error setting up module: {}", e)))?;

Expand Down
3 changes: 0 additions & 3 deletions crates/wasmtime/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ impl Instance for Wasi {
debug!("preparing module");
let spec = load_spec(self.bundle.clone())?;

debug!("call prehook before the start");
oci::setup_prestart_hooks(spec.hooks())?;

let m = prepare_module(engine.clone(), &spec, stdin, stdout, stderr)
.map_err(|e| Error::Others(format!("error setting up module: {}", e)))?;

Expand Down

0 comments on commit ec19a08

Please sign in to comment.