File tree 2 files changed +16
-18
lines changed
containerd-shim-wasmedge/src
containerd-shim-wasmtime/src
2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,14 @@ impl Executor for WasmEdgeExecutor {
55
55
56
56
fn can_handle ( & self , spec : & Spec ) -> bool {
57
57
// check if the entrypoint of the spec is a wasm binary.
58
- let args = oci:: get_args ( spec) ;
59
- if args. is_empty ( ) {
60
- return false ;
61
- }
62
-
63
- let start = args[ 0 ] . clone ( ) ;
64
- let mut iterator = start. split ( '#' ) ;
65
- let cmd = iterator. next ( ) . unwrap ( ) . to_string ( ) ;
66
- let path = PathBuf :: from ( cmd) ;
58
+ let ( module_name, _method) = oci:: get_module ( spec) ;
59
+ let module_name = match module_name {
60
+ Some ( m) => m,
61
+ None => {
62
+ return false
63
+ }
64
+ } ;
65
+ let path = PathBuf :: from ( module_name) ;
67
66
68
67
path. extension ( )
69
68
. map ( |ext| ext. to_ascii_lowercase ( ) )
Original file line number Diff line number Diff line change @@ -57,15 +57,14 @@ impl Executor for WasmtimeExecutor {
57
57
58
58
fn can_handle ( & self , spec : & Spec ) -> bool {
59
59
// check if the entrypoint of the spec is a wasm binary.
60
- let args = oci:: get_args ( spec) ;
61
- if args. is_empty ( ) {
62
- return false ;
63
- }
64
-
65
- let start = args[ 0 ] . clone ( ) ;
66
- let mut iterator = start. split ( '#' ) ;
67
- let cmd = iterator. next ( ) . unwrap ( ) . to_string ( ) ;
68
- let path = PathBuf :: from ( cmd) ;
60
+ let ( module_name, _method) = oci:: get_module ( spec) ;
61
+ let module_name = match module_name {
62
+ Some ( m) => m,
63
+ None => {
64
+ return false
65
+ }
66
+ } ;
67
+ let path = PathBuf :: from ( module_name) ;
69
68
70
69
// TODO: do we need to validate the wasm binary?
71
70
// ```rust
You can’t perform that action at this time.
0 commit comments