Repository navigation
Remove the WASM function runtime - #4885
Open
Adham-Kiwan wants to merge 1 commit into
Open
Adham-Kiwan wants to merge 1 commit into
Adham-Kiwan wants to merge 1 commit into
Conversation
Remove the wasmtime and Node.js based WASM runtimes together with the wasmtime-go and wasmexec dependencies, as agreed in kptdev#4881. NewWasmFn and WasmFn.Run are kept as stubs that return ErrWasmFunctionsRemoved, so running a function with --allow-alpha-wasm now fails with an error that says the feature was removed. The WASM loaders are left in place in case WASM support is revisited. The WASM e2e test cases now check for that error, and the KPT_FN_WASM_RUNTIME default is dropped from the Makefile. Fixes kptdev#4882 Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
Adham-Kiwan
requested review from
efiacor,
kispaljr,
liamfallon and
mozesl-nokia
as code owners
November 18, 2026 23:34
✅ Deploy Preview for kptdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change removing WASM function execution.
No open issues 🎉
What changed in this PR
Removes WASM function execution from kpt for #4882, while retaining API stubs and CLI flags that report the feature’s removal. OCI push/pull helpers remain unchanged; documentation updates are deferred to #4883.
Changes:
- Removes the Wasmtime and Node.js runtimes, JavaScript glue, and root-module runtime dependencies.
- Makes
NewWasmFnandWasmFn.RunreturnErrWasmFunctionsRemovedand updates CLI flag help. - Updates end-to-end tests to expect failure and removes obsolete runtime setup.
| File | Description |
|---|---|
pkg/fn/runtime/wasmtime.go |
Deletes the Wasmtime runtime implementation. |
pkg/fn/runtime/wasmtime_unsupported.go |
Deletes the non-CGO Wasmtime fallback. |
pkg/fn/runtime/wasm.go |
Adds removal-error stubs while retaining loaders. |
pkg/fn/runtime/nodejs.go |
Deletes the Node.js WASM runtime. |
pkg/fn/runtime/jsglue.go |
Deletes JavaScript runtime glue. |
make/info.mk |
Removes the default WASM runtime environment setting. |
go.sum |
Removes checksums for the deleted runtime dependencies. |
go.mod |
Removes wasmtime-go and wasmexec dependencies. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/teardown.sh |
Removes obsolete environment cleanup. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/setup.sh |
Removes obsolete Node.js runtime selection. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/diff.patch |
Expects failed render status instead of resource mutations. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/config.yaml |
Expects a nonzero exit and the removal message. |
e2e/testdata/fn-eval/wasm-function/.expected/diff.patch |
Removes the expected successful resource mutation. |
e2e/testdata/fn-eval/wasm-function/.expected/config.yaml |
Expects a nonzero exit and the removal message. |
cli/fn/render/cmdrender.go |
Updates retained WASM flag help for render failures. |
cli/fn/cmdeval/cmdeval.go |
Updates retained WASM flag help for eval failures. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This removes the WASM function runtime from kpt, as agreed in #4881 and discussion #4878.
pkg/fn/runtime/wasmtime.go,wasmtime_unsupported.go,nodejs.goandjsglue.go.github.com/bytecodealliance/wasmtime-goandgithub.com/prep/wasmexecdependencies fromgo.mod.NewWasmFnandWasmFn.Runas stubs. Both now return a newErrWasmFunctionsRemovederror:support for WASM functions has been removed from kpt, run the function as a container image or an executable instead. TheWasmLoader,OciLoaderandFsLoadertypes stay, as the issue asks, in case WASM support comes back later.--allow-alpha-wasmhelp text forfn evalandfn renderso it says the feature was removed. I kept the flag so existing scripts get the clear error and not "unknown flag".fn-render/basicpipeline-wasmandfn-eval/wasm-functione2e cases to expect the new error. Drop theirsetup.sh/teardown.shand theKPT_FN_WASM_RUNTIME ?= nodejsdefault inmake/info.mk, since nothing reads that variable any more.What this PR leaves alone:
kpt alpha wasm push/pullandpkg/wasm. They are OCI push/pull helpers and do not use the runtime. I can remove them here or in a follow-up, whichever you prefer.Docs:PR for Update WASM related documentation #4883.// indirectentries incli/go.mod.go mod tidyincli/can't run until a root module release contains this change.Fixes #4882
Testing
go build ./...andgo vet ./pkg/fn/... ./cli/fn/...with the workspace frommake workgo test ./pkg/fn/... ./cli/fn/...passgo test --tags=docker --run='TestFnRender/testdata/fn-render/basicpipeline-wasm|TestFnEval/testdata/fn-eval/wasm-function' ./e2e/pass against a freshly built binaryAI usage
I have used AI in the creation of this PR.
I have used the following AI tools:
I have reviewed the change and can explain it independently of the tool.