docs: add KRM function developer guide - #4726
Conversation
Add a developer guide for writing KRM functions with the Go SDK, covering a tutorial, interface selection (fn.Runner vs fn.ResourceListProcessor), testing, and containerizing. Sourced from the krm-functions-sdk docs and adapted into a Hugo subsection under guides/. Refs kptdev#4725 Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
liamfallon
left a comment
There was a problem hiding this comment.
Thanks @efiacor for doing this, this is something we have badly needed for a long time.
Add behavioral details verified against the SDK source: - testing: Kptfile counted as input, non-YAML files ignored, inputs read in sorted order, and WRITE_GOLDEN_OUTPUT intentionally fails the writing run - interfaces: note the ConfigMap .data functionConfig path and that the Runner no-add/remove rule is a convention, not a compile-time restriction - containerizing: note file mode uses an empty functionConfig Refs kptdev#4725 Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
- Update the Chapter 5 Go quickstart to match the overhauled get-started scaffold (HelloWorld, hello-world testdata, results.Infof) and use the current KubeObject/Results API instead of the deprecated helpers - Cross-link Chapter 5 to the KRM Function Developer Guide for interface choice, testing, and containerizing - Add an interface-selection recommendation to the guide's interfaces page (transformers/validators -> fn.Runner; generators/complex -> fn.ResourceListProcessor) Refs kptdev#4725 Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds a new “KRM Function Developer Guide” section to the docs site, providing end-to-end guidance for developing KRM functions with the Go SDK.
Changes:
- Introduces new guide pages: Tutorial, Interfaces, Testing, and Containerizing.
- Adds a new guide index page and links it from the main Guides index.
- Updates the “Developing Functions” book section to reference the new guide and refresh example content.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| documentation/content/en/guides/krm-functions/tutorial.md | New tutorial covering implementation, embedded docs, running modes, and golden tests. |
| documentation/content/en/guides/krm-functions/interfaces.md | New page explaining fn.Runner vs fn.ResourceListProcessor with examples. |
| documentation/content/en/guides/krm-functions/testing.md | New page documenting golden test conventions and unit testing approaches. |
| documentation/content/en/guides/krm-functions/containerizing.md | New page describing container image builds/runs for functions. |
| documentation/content/en/guides/krm-functions/_index.md | New section landing page linking to the new subsections. |
| documentation/content/en/guides/_index.md | Adds a link to the new KRM Function Developer Guide section. |
| documentation/content/en/book/05-developing-functions/_index.md | Updates the book chapter quickstart narrative/code and links to the new guide. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Adds a developer guide for writing KRM functions with the Go SDK, as a new subsection under
guides/krm-functions/:--help/--doc/standalone file mode)fn.Runnervsfn.ResourceListProcessorThe content is sourced from the
krm-functions-sdkrepo docs and adapted into Hugo pages (front matter,relrefcross-links, absolute source links). The parentguides/_index.mdlinks to the new subsection.Testing
hugocontent rendering succeeds with norelrefresolution errors (local CSS post-processing step is blocked by a sandbox fs restriction unrelated to these changes; it builds in CI).Refs #4725
This PR was prepared with AI assistance.