Skip to content

docs: add KRM function developer guide - #4726

Open
efiacor wants to merge 3 commits into
kptdev:mainfrom
Nordix:docs/krm-function-developer-guide
Open

docs: add KRM function developer guide#4726
efiacor wants to merge 3 commits into
kptdev:mainfrom
Nordix:docs/krm-function-developer-guide

Conversation

@efiacor

@efiacor efiacor commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a developer guide for writing KRM functions with the Go SDK, as a new subsection under guides/krm-functions/:

  • Tutorial — build a function end to end (embedded docs, golden tests, --help/--doc/standalone file mode)
  • Interfaces — when to use fn.Runner vs fn.ResourceListProcessor
  • Testing — golden test patterns and unit testing
  • Containerizing — packaging a function as a container image

The content is sourced from the krm-functions-sdk repo docs and adapted into Hugo pages (front matter, relref cross-links, absolute source links). The parent guides/_index.md links to the new subsection.

Testing

  • hugo content rendering succeeds with no relref resolution 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.

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>
@efiacor
efiacor requested review from a team September 2, 2026 01:02
@efiacor efiacor added the documentation Improvements or additions to documentation label Sep 2, 2026
@efiacor efiacor self-assigned this Sep 2, 2026
@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 3ca2792
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a985e913c282700087f1064
😎 Deploy Preview https://deploy-preview-4726--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@liamfallon liamfallon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @efiacor for doing this, this is something we have badly needed for a long time.

@efiacor
efiacor marked this pull request as draft September 2, 2026 08:44
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>
@efiacor
efiacor marked this pull request as ready for review September 2, 2026 17:46
@efiacor
efiacor requested review from a team and a balanced review from Copilot September 2, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread documentation/content/en/book/05-developing-functions/_index.md
Comment thread documentation/content/en/book/05-developing-functions/_index.md
Comment thread documentation/content/en/book/05-developing-functions/_index.md
Comment thread documentation/content/en/book/05-developing-functions/_index.md
Comment thread documentation/content/en/guides/krm-functions/testing.md
Comment thread documentation/content/en/guides/krm-functions/testing.md
Comment thread documentation/content/en/book/05-developing-functions/_index.md
Comment thread documentation/content/en/guides/krm-functions/interfaces.md
Comment thread documentation/content/en/guides/krm-functions/tutorial.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants