From 3327b4b71f8e7f72a7e8449e34b0306358e56bc4 Mon Sep 17 00:00:00 2001 From: Surbhi Date: Wed, 18 Mar 2026 18:19:20 +0530 Subject: [PATCH 1/7] docs: Add WASM function support documentation Add comprehensive documentation for WASM function support in kpt, covering how to run, develop, and deploy WASM functions. Closes #4296 Signed-off-by: Surbhi --- .../book/04-using-functions/wasm-functions.md | 324 ++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 documentation/content/en/book/04-using-functions/wasm-functions.md diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md new file mode 100644 index 0000000000..e98c842a86 --- /dev/null +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -0,0 +1,324 @@ +--- +title: "Using WASM Functions" +linkTitle: "Using WASM Functions" +weight: 5 +description: > + How to run, develop, and deploy WebAssembly (WASM) functions with kpt. +--- + +WASM functions are an alternative to container-based KRM functions. They're faster to start, smaller to distribute, and run in a sandboxed environment. + +## Why use WASM functions? + +{{< warning type=warning title="Note" >}} +WASM support in kpt is currently in alpha and not ready for production use. The API and behavior may change in future releases. +{{< /warning >}} + +WASM functions have some advantages over container-based functions: + +- Faster startup - no container runtime needed +- Smaller size - WASM modules are typically much smaller than container images +- Better security - sandboxed execution with no host access by default +- More portable - run anywhere WASM is supported +- Lower resource usage + +## Running WASM functions + +WASM support is an alpha feature. You need to use the `--allow-alpha-wasm` flag to enable it. + +### With `fn render` + +Add the WASM function to your Kptfile pipeline: + +```yaml +# Kptfile +apiVersion: kpt.dev/v1 +kind: Kptfile +metadata: + name: my-package +pipeline: + mutators: + - image: gcr.io/my-org/my-wasm-fn:v1.0.0 + configMap: + key: value +``` + +```shell +kpt fn render my-package --allow-alpha-wasm +``` + +kpt will detect the function as WASM if the OCI image has a `js/wasm` platform manifest. + +### With `fn eval` + +Run WASM functions imperatively: + +```shell +kpt fn eval my-package --allow-alpha-wasm -i gcr.io/my-org/my-wasm-fn:v1.0.0 -- key=value +``` + +### Using local WASM files + +You can run local `.wasm` files with the `--exec` flag: + +```shell +kpt fn eval my-package --allow-alpha-wasm --exec ./my-function.wasm +``` + +You can also declare local WASM files in your `Kptfile`: + +```yaml +# Kptfile +apiVersion: kpt.dev/v1 +kind: Kptfile +metadata: + name: my-package +pipeline: + mutators: + - exec: ./functions/my-function.wasm +``` + +```shell +kpt fn render my-package --allow-alpha-wasm --allow-exec +``` + +Note: Using local WASM files makes your package less portable since the file needs to exist on every system. + +## Publishing WASM functions + +### Push a WASM module + +Compress and push a WASM module to an OCI registry: + +```shell +kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 +``` + +What this does: +1. Compresses the WASM file into a tar archive +2. Creates an OCI image with `js/wasm` platform +3. Pushes to the registry + +### Pull a WASM module + +Download and decompress a WASM module: + +```shell +kpt alpha wasm pull gcr.io/my-org/my-wasm-fn:v1.0.0 ./my-function.wasm +``` + +Useful for: +- Testing WASM functions locally +- Inspecting modules +- Offline caching + +## Developing WASM functions + +WASM functions follow the [KRM Functions Specification](https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md). They receive a `ResourceList` as input and return a `ResourceList` as output. + +### What you need + +- A language that compiles to WASM (Go, Rust, etc.) +- WASM build toolchain +- KRM functions SDK + +### Example: Go WASM function + +Here's how to build a Go KRM function for WASM. You need two files - one for regular builds and one for WASM: + +`main.go` (regular build): + +```go +//go:build !(js && wasm) + +package main + +import ( + "os" + + "github.com/kptdev/krm-functions-sdk/go/fn" +) + +func main() { + if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil { + os.Exit(1) + } +} + +func process(rl *fn.ResourceList) (bool, error) { + for i := range rl.Items { + // Your transformation logic + rl.Items[i].SetAnnotation("processed-by", "my-fn") + } + return true, nil +} +``` + +`main_js.go` (WASM build): + +```go +//go:build js && wasm + +package main + +import ( + "syscall/js" + + "github.com/kptdev/krm-functions-sdk/go/fn" +) + +func main() { + if err := run(); err != nil { + panic(err) + } +} + +func run() error { + resourceList := []byte("") + + js.Global().Set("processResourceList", resourceListWrapper(&resourceList)) + js.Global().Set("processResourceListErrors", resourceListErrors(&resourceList)) + + // Keep the program running + <-make(chan bool) + return nil +} + +// process applies the same transformation logic as in the non-WASM build. +func process(rl *fn.ResourceList) (bool, error) { + for i := range rl.Items { + // Your transformation logic + rl.Items[i].SetAnnotation("processed-by", "my-fn") + } + return true, nil +} + +func transform(input []byte) ([]byte, error) { + return fn.Run(fn.ResourceListProcessorFunc(process), input) +} + +func resourceListWrapper(resourceList *[]byte) js.Func { + return js.FuncOf(func(this js.Value, args []js.Value) any { + if len(args) != 1 { + return "Invalid number of arguments" + } + input := args[0].String() + output, err := transform([]byte(input)) + *resourceList = output + if err != nil { + return "unable to process: " + err.Error() + } + return string(output) + }) +} + +func resourceListErrors(resourceList *[]byte) js.Func { + return js.FuncOf(func(this js.Value, args []js.Value) any { + rl, err := fn.ParseResourceList(*resourceList) + if err != nil { + return "" + } + errors := "" + for _, r := range rl.Results { + if r.Severity == "error" { + errors += r.Message + } + } + return errors + }) +} +``` + +### Build for WASM + +```shell +GOOS=js GOARCH=wasm go build -o my-function.wasm . +``` + +### Test locally + +```shell +kpt fn eval ./test-package --allow-alpha-wasm --exec ./my-function.wasm +``` + +### Publish + +Push to a registry: + +```shell +kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 + +# Test the published version +kpt fn eval ./test-package --allow-alpha-wasm -i gcr.io/my-org/my-wasm-fn:v1.0.0 +``` + +## Complete example + +From development to deployment: + +```shell +# 1. Write your function code (main.go and main_js.go) + +# 2. Build +GOOS=js GOARCH=wasm go build -o my-function.wasm . + +# 3. Test locally +kpt fn eval ./test-package --allow-alpha-wasm --exec ./my-function.wasm + +# 4. Publish +kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 + +# 5. Use in a package +cat < Kptfile +apiVersion: kpt.dev/v1 +kind: Kptfile +metadata: + name: my-package +pipeline: + mutators: + - image: gcr.io/my-org/my-wasm-fn:v1.0.0 +EOF + +# 6. Render +kpt fn render my-package --allow-alpha-wasm +``` + +## Limitations + +### Alpha status + +WASM support is alpha, which means: +- API may change +- Requires `--allow-alpha-wasm` flag +- Some features may be limited + +### Security + +WASM functions run in a sandbox: +- No network access +- No filesystem access (except input/output resources) +- Can't execute system commands + +This is more secure but also more restrictive. + +### Performance + +- Faster startup than containers +- CPU-intensive operations may be slower +- Different memory patterns +- Benchmark if performance is critical + +### Compatibility + +Not all container functions can convert to WASM: +- Functions needing network access +- Functions with complex dependencies +- Platform-specific code + +## See also + +- [KRM Functions Specification](https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md) +- [Functions Catalog](https://catalog.kpt.dev/) +- [kpt alpha wasm push](../../../reference/cli/alpha/wasm/push/) +- [kpt alpha wasm pull](../../../reference/cli/alpha/wasm/pull/) +- [WASM function examples](https://github.com/kptdev/krm-functions-catalog/tree/main/functions/go) From f0c62a48c9b2da374e0000e5f3cdfa2f3925202a Mon Sep 17 00:00:00 2001 From: Surbhi Date: Wed, 18 Mar 2026 18:24:33 +0530 Subject: [PATCH 2/7] docs: fix unreachable return nil in WASM run() example Replace <-make(chan bool) + return nil with select{} to avoid the unreachable code and clarify the blocking intent. Signed-off-by: Surbhi --- .../content/en/book/04-using-functions/wasm-functions.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index e98c842a86..c13da135c0 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -180,8 +180,7 @@ func run() error { js.Global().Set("processResourceListErrors", resourceListErrors(&resourceList)) // Keep the program running - <-make(chan bool) - return nil + select {} } // process applies the same transformation logic as in the non-WASM build. From 889fc1b3c809021d74064880ec096dbbc48caf4d Mon Sep 17 00:00:00 2001 From: Surbhi Date: Thu, 19 Mar 2026 02:37:33 +0530 Subject: [PATCH 3/7] docs: fix Copilot review issues in wasm-functions.md - Store js.Func values in package-level vars to prevent GC - Add --allow-exec flag to all fn eval --exec examples - Fix gofmt indentation in Go code snippets (tabs not spaces) Signed-off-by: Surbhi --- .../book/04-using-functions/wasm-functions.md | 126 ++++++++++-------- 1 file changed, 67 insertions(+), 59 deletions(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index c13da135c0..67f2d821d4 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -1,4 +1,4 @@ ---- +--- title: "Using WASM Functions" linkTitle: "Using WASM Functions" weight: 5 @@ -62,7 +62,7 @@ kpt fn eval my-package --allow-alpha-wasm -i gcr.io/my-org/my-wasm-fn:v1.0.0 -- You can run local `.wasm` files with the `--exec` flag: ```shell -kpt fn eval my-package --allow-alpha-wasm --exec ./my-function.wasm +kpt fn eval my-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm ``` You can also declare local WASM files in your `Kptfile`: @@ -134,23 +134,23 @@ Here's how to build a Go KRM function for WASM. You need two files - one for reg package main import ( - "os" - - "github.com/kptdev/krm-functions-sdk/go/fn" + "os" + + "github.com/kptdev/krm-functions-sdk/go/fn" ) func main() { - if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil { - os.Exit(1) - } + if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil { + os.Exit(1) + } } func process(rl *fn.ResourceList) (bool, error) { - for i := range rl.Items { - // Your transformation logic - rl.Items[i].SetAnnotation("processed-by", "my-fn") - } - return true, nil + for i := range rl.Items { + // Your transformation logic + rl.Items[i].SetAnnotation("processed-by", "my-fn") + } + return true, nil } ``` @@ -162,69 +162,77 @@ func process(rl *fn.ResourceList) (bool, error) { package main import ( - "syscall/js" - - "github.com/kptdev/krm-functions-sdk/go/fn" + "syscall/js" + + "github.com/kptdev/krm-functions-sdk/go/fn" +) + +// Keep js.Func values referenced at package level to prevent garbage collection. +var ( + processResourceListFunc js.Func + processResourceListErrorsFunc js.Func ) func main() { - if err := run(); err != nil { - panic(err) - } + if err := run(); err != nil { + panic(err) + } } func run() error { - resourceList := []byte("") - - js.Global().Set("processResourceList", resourceListWrapper(&resourceList)) - js.Global().Set("processResourceListErrors", resourceListErrors(&resourceList)) - - // Keep the program running - select {} + resourceList := []byte("") + + processResourceListFunc = resourceListWrapper(&resourceList) + js.Global().Set("processResourceList", processResourceListFunc) + processResourceListErrorsFunc = resourceListErrors(&resourceList) + js.Global().Set("processResourceListErrors", processResourceListErrorsFunc) + + // Keep the program running + select {} } // process applies the same transformation logic as in the non-WASM build. func process(rl *fn.ResourceList) (bool, error) { - for i := range rl.Items { - // Your transformation logic - rl.Items[i].SetAnnotation("processed-by", "my-fn") - } - return true, nil + for i := range rl.Items { + // Your transformation logic + rl.Items[i].SetAnnotation("processed-by", "my-fn") + } + return true, nil } func transform(input []byte) ([]byte, error) { - return fn.Run(fn.ResourceListProcessorFunc(process), input) + return fn.Run(fn.ResourceListProcessorFunc(process), input) } func resourceListWrapper(resourceList *[]byte) js.Func { - return js.FuncOf(func(this js.Value, args []js.Value) any { - if len(args) != 1 { - return "Invalid number of arguments" - } - input := args[0].String() - output, err := transform([]byte(input)) - *resourceList = output - if err != nil { - return "unable to process: " + err.Error() - } - return string(output) - }) + return js.FuncOf(func(this js.Value, args []js.Value) any { + if len(args) != 1 { + return "Invalid number of arguments" + } + input := args[0].String() + output, err := transform([]byte(input)) + *resourceList = output + if err != nil { + return "unable to process: " + err.Error() + } + return string(output) + }) } func resourceListErrors(resourceList *[]byte) js.Func { - return js.FuncOf(func(this js.Value, args []js.Value) any { - rl, err := fn.ParseResourceList(*resourceList) - if err != nil { - return "" - } - errors := "" - for _, r := range rl.Results { - if r.Severity == "error" { - errors += r.Message - } - } - return errors - }) + return js.FuncOf(func(this js.Value, args []js.Value) any { + rl, err := fn.ParseResourceList(*resourceList) + if err != nil { + return "" + } + errors := "" + for _, r := range rl.Results { + if r.Severity == "error" { + errors += r.Message + } + } + return errors + }) } ``` @@ -237,7 +245,7 @@ GOOS=js GOARCH=wasm go build -o my-function.wasm . ### Test locally ```shell -kpt fn eval ./test-package --allow-alpha-wasm --exec ./my-function.wasm +kpt fn eval ./test-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm ``` ### Publish @@ -262,7 +270,7 @@ From development to deployment: GOOS=js GOARCH=wasm go build -o my-function.wasm . # 3. Test locally -kpt fn eval ./test-package --allow-alpha-wasm --exec ./my-function.wasm +kpt fn eval ./test-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm # 4. Publish kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 From 23b2b31aaecf42806bf1bc2216bf5a7fc24de360 Mon Sep 17 00:00:00 2001 From: Surbhi Date: Thu, 19 Mar 2026 17:47:08 +0530 Subject: [PATCH 4/7] docs: address efiacor review comments on wasm-functions.md - Replace Go code examples with link to starlark example in krm-functions-catalog - Replace gcr.io registry references with example.registry.io dummy registry Signed-off-by: Surbhi --- .../book/04-using-functions/wasm-functions.md | 130 ++---------------- 1 file changed, 10 insertions(+), 120 deletions(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index 67f2d821d4..9ee9290be7 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -1,4 +1,4 @@ ---- +--- title: "Using WASM Functions" linkTitle: "Using WASM Functions" weight: 5 @@ -38,7 +38,7 @@ metadata: name: my-package pipeline: mutators: - - image: gcr.io/my-org/my-wasm-fn:v1.0.0 + - image: example.registry.io/my-org/my-wasm-fn:v1.0.0 configMap: key: value ``` @@ -54,7 +54,7 @@ kpt will detect the function as WASM if the OCI image has a `js/wasm` platform m Run WASM functions imperatively: ```shell -kpt fn eval my-package --allow-alpha-wasm -i gcr.io/my-org/my-wasm-fn:v1.0.0 -- key=value +kpt fn eval my-package --allow-alpha-wasm -i example.registry.io/my-org/my-wasm-fn:v1.0.0 -- key=value ``` ### Using local WASM files @@ -91,7 +91,7 @@ Note: Using local WASM files makes your package less portable since the file nee Compress and push a WASM module to an OCI registry: ```shell -kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 +kpt alpha wasm push ./my-function.wasm example.registry.io/my-org/my-wasm-fn:v1.0.0 ``` What this does: @@ -104,7 +104,7 @@ What this does: Download and decompress a WASM module: ```shell -kpt alpha wasm pull gcr.io/my-org/my-wasm-fn:v1.0.0 ./my-function.wasm +kpt alpha wasm pull example.registry.io/my-org/my-wasm-fn:v1.0.0 ./my-function.wasm ``` Useful for: @@ -124,117 +124,7 @@ WASM functions follow the [KRM Functions Specification](https://github.com/kuber ### Example: Go WASM function -Here's how to build a Go KRM function for WASM. You need two files - one for regular builds and one for WASM: - -`main.go` (regular build): - -```go -//go:build !(js && wasm) - -package main - -import ( - "os" - - "github.com/kptdev/krm-functions-sdk/go/fn" -) - -func main() { - if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil { - os.Exit(1) - } -} - -func process(rl *fn.ResourceList) (bool, error) { - for i := range rl.Items { - // Your transformation logic - rl.Items[i].SetAnnotation("processed-by", "my-fn") - } - return true, nil -} -``` - -`main_js.go` (WASM build): - -```go -//go:build js && wasm - -package main - -import ( - "syscall/js" - - "github.com/kptdev/krm-functions-sdk/go/fn" -) - -// Keep js.Func values referenced at package level to prevent garbage collection. -var ( - processResourceListFunc js.Func - processResourceListErrorsFunc js.Func -) - -func main() { - if err := run(); err != nil { - panic(err) - } -} - -func run() error { - resourceList := []byte("") - - processResourceListFunc = resourceListWrapper(&resourceList) - js.Global().Set("processResourceList", processResourceListFunc) - processResourceListErrorsFunc = resourceListErrors(&resourceList) - js.Global().Set("processResourceListErrors", processResourceListErrorsFunc) - - // Keep the program running - select {} -} - -// process applies the same transformation logic as in the non-WASM build. -func process(rl *fn.ResourceList) (bool, error) { - for i := range rl.Items { - // Your transformation logic - rl.Items[i].SetAnnotation("processed-by", "my-fn") - } - return true, nil -} - -func transform(input []byte) ([]byte, error) { - return fn.Run(fn.ResourceListProcessorFunc(process), input) -} - -func resourceListWrapper(resourceList *[]byte) js.Func { - return js.FuncOf(func(this js.Value, args []js.Value) any { - if len(args) != 1 { - return "Invalid number of arguments" - } - input := args[0].String() - output, err := transform([]byte(input)) - *resourceList = output - if err != nil { - return "unable to process: " + err.Error() - } - return string(output) - }) -} - -func resourceListErrors(resourceList *[]byte) js.Func { - return js.FuncOf(func(this js.Value, args []js.Value) any { - rl, err := fn.ParseResourceList(*resourceList) - if err != nil { - return "" - } - errors := "" - for _, r := range rl.Results { - if r.Severity == "error" { - errors += r.Message - } - } - return errors - }) -} -``` +For a complete working example of a Go WASM function, see the [starlark function in the krm-functions-catalog](https://github.com/kptdev/krm-functions-catalog/tree/main/functions/go/starlark), which shows the two-file pattern (`run.go` for regular builds and `run_js.go` for WASM builds). ### Build for WASM @@ -253,10 +143,10 @@ kpt fn eval ./test-package --allow-alpha-wasm --allow-exec --exec ./my-function. Push to a registry: ```shell -kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 +kpt alpha wasm push ./my-function.wasm example.registry.io/my-org/my-wasm-fn:v1.0.0 # Test the published version -kpt fn eval ./test-package --allow-alpha-wasm -i gcr.io/my-org/my-wasm-fn:v1.0.0 +kpt fn eval ./test-package --allow-alpha-wasm -i example.registry.io/my-org/my-wasm-fn:v1.0.0 ``` ## Complete example @@ -273,7 +163,7 @@ GOOS=js GOARCH=wasm go build -o my-function.wasm . kpt fn eval ./test-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm # 4. Publish -kpt alpha wasm push ./my-function.wasm gcr.io/my-org/my-wasm-fn:v1.0.0 +kpt alpha wasm push ./my-function.wasm example.registry.io/my-org/my-wasm-fn:v1.0.0 # 5. Use in a package cat < Kptfile @@ -283,7 +173,7 @@ metadata: name: my-package pipeline: mutators: - - image: gcr.io/my-org/my-wasm-fn:v1.0.0 + - image: example.registry.io/my-org/my-wasm-fn:v1.0.0 EOF # 6. Render From 361de4958a0a529ab274604772c3c434d06d6b47 Mon Sep 17 00:00:00 2001 From: SurbhiAgarwal Date: Thu, 19 Mar 2026 17:57:40 +0530 Subject: [PATCH 5/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../en/book/04-using-functions/wasm-functions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index 9ee9290be7..f873eda72d 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -191,12 +191,12 @@ WASM support is alpha, which means: ### Security -WASM functions run in a sandbox: -- No network access -- No filesystem access (except input/output resources) -- Can't execute system commands +WASM functions are designed to run in a sandboxed environment, but the exact security properties depend on the WASM runtime and how it is configured: +- Some runtimes (for example, `wasmtime` with default settings) do not grant network or filesystem access unless you explicitly enable those capabilities. +- Other runtimes (for example, a Node.js-based WASM runtime) execute the module within a local `node` process, where filesystem and network access may be possible depending on the glue code and module implementation. +- In all cases, you should treat the WASM runtime as part of your trusted computing base and review its configuration and allowed host APIs. -This is more secure but also more restrictive. +Compared to running arbitrary container images, a well-configured WASM runtime can offer stronger isolation, but the actual security guarantees depend on the chosen runtime and its configuration. ### Performance From d22a898cbb34d83a9cb7f820cff863f67c3808aa Mon Sep 17 00:00:00 2001 From: SurbhiAgarwal Date: Thu, 19 Mar 2026 22:08:33 +0530 Subject: [PATCH 6/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../content/en/book/04-using-functions/wasm-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index f873eda72d..a35ec53a9a 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -62,7 +62,7 @@ kpt fn eval my-package --allow-alpha-wasm -i example.registry.io/my-org/my-wasm- You can run local `.wasm` files with the `--exec` flag: ```shell -kpt fn eval my-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm +kpt fn eval my-package --allow-alpha-wasm --exec ./my-function.wasm ``` You can also declare local WASM files in your `Kptfile`: From c0677585cdd20c831d79adf1f9697755845dc713 Mon Sep 17 00:00:00 2001 From: SurbhiAgarwal Date: Thu, 19 Mar 2026 22:08:40 +0530 Subject: [PATCH 7/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../content/en/book/04-using-functions/wasm-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/content/en/book/04-using-functions/wasm-functions.md b/documentation/content/en/book/04-using-functions/wasm-functions.md index a35ec53a9a..c02a11ca27 100644 --- a/documentation/content/en/book/04-using-functions/wasm-functions.md +++ b/documentation/content/en/book/04-using-functions/wasm-functions.md @@ -160,7 +160,7 @@ From development to deployment: GOOS=js GOARCH=wasm go build -o my-function.wasm . # 3. Test locally -kpt fn eval ./test-package --allow-alpha-wasm --allow-exec --exec ./my-function.wasm +kpt fn eval ./test-package --allow-alpha-wasm --exec ./my-function.wasm # 4. Publish kpt alpha wasm push ./my-function.wasm example.registry.io/my-org/my-wasm-fn:v1.0.0