Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions crates/containerd-shim-wasmedge/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ impl Executor for WasmEdgeExecutor {

fn can_handle(&self, spec: &Spec) -> bool {
// check if the entrypoint of the spec is a wasm binary.
let args = oci::get_args(spec);
if args.is_empty() {
return false;
}

let start = args[0].clone();
let mut iterator = start.split('#');
let cmd = iterator.next().unwrap().to_string();
let path = PathBuf::from(cmd);
let (module_name, _method) = oci::get_module(spec);
let module_name = match module_name {
Some(m) => m,
None => {
log::info!("WasmEdge cannot handle this workload, no arguments provided");
return false;
}
};
let path = PathBuf::from(module_name);

path.extension()
.map(|ext| ext.to_ascii_lowercase())
Expand Down
18 changes: 9 additions & 9 deletions crates/containerd-shim-wasmtime/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ impl Executor for WasmtimeExecutor {

fn can_handle(&self, spec: &Spec) -> bool {
// check if the entrypoint of the spec is a wasm binary.
let args = oci::get_args(spec);
if args.is_empty() {
return false;
}

let start = args[0].clone();
let mut iterator = start.split('#');
let cmd = iterator.next().unwrap().to_string();
let path = PathBuf::from(cmd);
let (module_name, _method) = oci::get_module(spec);
let module_name = match module_name {
Some(m) => m,
None => {
log::info!("Wasmtime cannot handle this workload, no arguments provided");
return false;
}
};
let path = PathBuf::from(module_name);

// TODO: do we need to validate the wasm binary?
// ```rust
Expand Down