You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(builtins): built-in runtime for apply-replacements and starlark (#4307)
Closes#4307
Implements a built-in runtime for curated KRM functions inside kpt,
allowing apply-replacements and starlark to run without pulling images
from Docker Hub, eliminating the external SDK dependency.
## Approach
Avoids circular dependency between Porch and kpt by moving the built-in
runtime concept into kpt directly using kyaml/fn/framework instead of
krm-functions-sdk.
## Architecture
A thread-safe self-registration registry (internal/builtins/registry)
allows KRM function implementations to register themselves via init().
The fnruntime runner checks this registry before falling back to Docker
or WASM, preserving existing behavior for unregistered functions.
Priority order in fnruntime/runner.go:
1. pkg-context builtin (existing)
2. Builtin registry (new, no Docker needed)
3. Docker / WASM (fallback, unchanged)
## Functions included
- apply-replacements: ghcr.io/kptdev/krm-functions-catalog/apply-replacements
- starlark: ghcr.io/kptdev/krm-functions-catalog/starlark
## Implementation notes
- Removed dependency on krm-functions-sdk/go/fn and krm-functions-catalog/starlark
- Vendored starlark runtime locally using kyaml/yaml instead of SDK
## Verified locally
[PASS] apply-replacements in 0s (no Docker)
[PASS] starlark in 0s (no Docker)
Signed-off-by: abdulrahman11a <[email protected]>
0 commit comments