Overhaul get-started example and make kpt.dev the docs source of truth - #769
Open
efiacor wants to merge 2 commits into
Open
Overhaul get-started example and make kpt.dev the docs source of truth#769efiacor wants to merge 2 commits into
efiacor wants to merge 2 commits into
Conversation
Replace the no-op scaffold with a small, working hello-world mutator that builds a greeting from its functionConfig and stamps it as an annotation on every resource. The example now: - implements fn.Runner (the recommended interface for transformers) - demonstrates functionConfig-to-field mapping via JSON tags - ships a golden test whose _expected.yaml shows a real input->output diff - documents its behavior in README.md/metadata.yaml (used by --help/--doc) Rename the testdata case from noop-passthrough to hello-world. Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
The developer guide (tutorial, interfaces, testing, containerizing) now lives on the kpt documentation site under guides/krm-functions. To avoid two copies drifting apart, remove the duplicated markdown from this repo and point the top-level README at the canonical pages on kpt.dev. The runnable example (go/get-started) stays here as the source of truth for example code. Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
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.
Summary
Two related changes to improve the getting-started experience for KRM function authors:
1.
go/get-startedis now a working hello-world function (was a no-op scaffold).It builds a greeting from its functionConfig and stamps it as an annotation on every resource, so the golden test shows a real input→output diff. It implements
fn.Runner(the recommended interface for transformers), demonstrates functionConfig-to-field mapping, and documents itself viaREADME.md/metadata.yaml(surfaced through--help/--doc).2. Documentation is now single-source on kpt.dev.
The developer guide (tutorial, interfaces, testing, containerizing) lives on the kpt documentation site under
guides/krm-functions. To avoid two copies drifting, this removes the duplicated markdown fromdocs/here and repoints the top-level README at the canonical pages on kpt.dev. The runnable example stays here as the source of truth for example code.Companion docs PR: kptdev/kpt#4726 (adds the guide and reconciles the developing-functions chapter). That PR should merge first so the kpt.dev links resolve.
Testing
go build,go vet, andgo testpass forgo/get-started(golden test deterministic across runs).--helpand--docverified against the updated README/metadata.docs/*.mdfiles remain.Refs kptdev/kpt#4725
This PR was prepared with AI assistance.