You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some KRM functions fail when using kpt fn doc because they attempt to parse input from stdin even when the --help flag is provided. This results in the error: failed to parse input bytes: expected exactly one object, got 0.
Problem Statement
When running kpt fn doc <function>, the command invokes the container with --help to retrieve documentation. However, certain KRM functions are designed to always read from stdin, regardless of flags provided. When no input is piped, these functions fail before displaying help documentation.
Create a separate tracking issue to document which officially supported functions (from catalog.kpt.dev) should eventually be fixed upstream to handle --help gracefully
Work with function maintainers over time to implement proper --help handling
Do you approve proceeding with the kpt fn doc level fix?
Should we prioritize fixing individual functions instead?
Would you like both approaches (immediate fix + long-term upstream fixes)?
Note: This issue was created following feedback from @efiacor on PR #4352, who approved the approach but requested proper tracking of functions that need upstream fixes.
Summary
Some KRM functions fail when using
kpt fn docbecause they attempt to parse input from stdin even when the--helpflag is provided. This results in the error:failed to parse input bytes: expected exactly one object, got 0.Problem Statement
When running
kpt fn doc <function>, the command invokes the container with--helpto retrieve documentation. However, certain KRM functions are designed to always read from stdin, regardless of flags provided. When no input is piped, these functions fail before displaying help documentation.Affected functions include (but not limited to):
set-namespaceset-labelsset-annotationsProposed Solution
PR #4352 implements a fix at the
kpt fn doclevel by providing an empty ResourceList as stdin when invoking containers with--help. This approach:✅ Pros:
--helpgracefullyAlternative Approach
Fix each KRM function individually to handle
--helpwithout requiring stdin input.✅ Pros:
Request for Approval
We're seeking official approval to proceed with the fix in PR #4352 (Option 1: fix at
kpt fn doclevel) for the following reasons:Follow-up Work
If approved, we should:
--helpgracefully--helphandlingRelated Issues
Questions for Maintainers
kpt fn doclevel fix?Note: This issue was created following feedback from @efiacor on PR #4352, who approved the approach but requested proper tracking of functions that need upstream fixes.