Skip to content

Commit

Permalink
Add comment on the new function
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <jstur@microsoft.com>
  • Loading branch information
jsturtevant committed Aug 4, 2023
1 parent f26fb2e commit 7d70f40
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/containerd-shim-wasm/src/sandbox/oci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ pub fn get_args(spec: &Spec) -> &[String] {
}
}

// get_module returns the module name and exported function name to be called
// from the arguments on the runtime spec process field. The first argument will
// be the module name and the default function name is "_start".
//
// If there is a '#' in the argument it will split the string
// returning the first part as the module name and the second part as the function
// name.
//
// example: "module.wasm#function" will return (Some("module.wasm"), "function")
//
// If there are no arguments then it will return (None, "_start")
pub fn get_module(spec: &Spec) -> (Option<String>, String) {
let args = get_args(spec);

Expand Down

0 comments on commit 7d70f40

Please sign in to comment.