cli-runtime
cli-runtime copied to clipboard
allow a cutstom io.Reader for stdin in resource.Builder
k8s.io/kubectl affords genericclioptions.IOStreams to allow overriding stdin, stdout, and stderr. However, the resource.Builder and resource.Visitor abstractions don't have the option to allow configuring a custom stdin, which ultimately leads to unexpected behavior when a consumer of the k8s.io/kubectl library overrides the stdin but their program end up still getting IO blocked on os.Stdin. So resource.Builder and resource.Visitor should provide the ability for stdin to be overridden so that k8s.io/kubectl can use that ability to override stdin when appropriate.