Skip to content

fn doc: remove invalid --stdin flag from docker run args#4577

Merged
liamfallon merged 1 commit into
kptdev:mainfrom
Nordix:fix_fn_doc_stdin_flag
Jun 10, 2026
Merged

fn doc: remove invalid --stdin flag from docker run args#4577
liamfallon merged 1 commit into
kptdev:mainfrom
Nordix:fix_fn_doc_stdin_flag

Conversation

@efiacor

@efiacor efiacor commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Remove --stdin from docker run args in kpt fn doc.

--stdin is a podman-only flag — Docker doesn't recognise it and fails with unknown flag: --stdin. The -i flag alone keeps stdin open, which is all that's needed to pipe the empty ResourceList for backward compat with older functions.

Introduced in 3998a5d as a workaround for functions that read stdin even when --help is passed. With SDK v1.0.4 (AsMain checks os.Args for --help/--doc before reading stdin) the workaround is unnecessary for migrated functions, but -i + the piped empty ResourceList still covers old ones.

AI assisted, author has fully verified all code.

@efiacor efiacor self-assigned this Jun 9, 2026
Copilot AI review requested due to automatic review settings June 9, 2026 10:36
@efiacor efiacor added the bug Something isn't working label Jun 9, 2026
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 0a62afb
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a27f2ec3b4b7200080dd53e
😎 Deploy Preview https://deploy-preview-4577--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.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area/fn-runtime KRM function runtime labels Jun 9, 2026
@efiacor efiacor requested a review from a team June 9, 2026 10:36

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.

Pull request overview

This PR fixes kpt fn doc when running functions via Docker by removing the unsupported --stdin flag from the container runtime run arguments, while keeping stdin open via -i for backward compatibility with functions that still read stdin even for --help.

Changes:

  • Remove --stdin from the docker run argument list used by kpt fn doc.
  • Keep -i and the piped empty ResourceList stdin to preserve compatibility for older functions expecting input.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread commands/fn/doc/cmdfndoc.go Outdated
The --stdin flag is podman-only and causes 'unknown flag' errors with Docker. The -i flag alone is sufficient to keep stdin open for piping the empty ResourceList.

Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
@efiacor efiacor force-pushed the fix_fn_doc_stdin_flag branch from e981431 to 0a62afb Compare June 9, 2026 11:03
@dosubot dosubot Bot added the lgtm label Jun 10, 2026
@liamfallon liamfallon merged commit 4566e63 into kptdev:main Jun 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fn-runtime KRM function runtime bug Something isn't working lgtm size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants