⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@pmady
Copy link

@pmady pmady commented Jan 15, 2026

Some KRM functions fail with 'kpt fn doc' because they try to parse input from stdin even when --help flag is provided, resulting in the error: 'failed to parse input bytes: expected exactly one object, got 0'

This fix provides an empty ResourceList as stdin when running containers with --help flag, allowing functions that expect input to work properly while still displaying help documentation.

Changes:

  • Add -i and --stdin flags to docker run command
  • Provide empty ResourceList YAML structure as stdin
  • Prevents 'expected exactly one object' errors for functions like set-namespace, set-labels, etc.

Fixes #4278

Some KRM functions fail with 'kpt fn doc' because they try to parse
input from stdin even when --help flag is provided, resulting in the
error: 'failed to parse input bytes: expected exactly one object, got 0'

This fix provides an empty ResourceList as stdin when running containers
with --help flag, allowing functions that expect input to work properly
while still displaying help documentation.

Changes:
- Add -i and --stdin flags to docker run command
- Provide empty ResourceList YAML structure as stdin
- Prevents 'expected exactly one object' errors for functions like
  set-namespace, set-labels, etc.

Fixes kptdev#4278

Signed-off-by: pmady <[email protected]>
@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 5d35100
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69691eece836e4000746a791
😎 Deploy Preview https://deploy-preview-4352--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "kpt fn doc" command only works on some krm functions

1 participant