mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Remove genericclioptions.IOStreams struct
Since the codebase already migrates to genericiooptions.IOStreams, external tools will automatically start consuming the new one. This PR deletes deprecated struct because codebase does not rely on it already. We keep `NewTestIOStreams` and `NewTestIOStreamsDiscard` functions to provide users a smooth migration.
This commit is contained in:
parent
c3497b30ac
commit
8d9386fc40
@ -18,30 +18,19 @@ package genericclioptions
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
// IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing.
|
||||
// Inconsistent and different names make it hard to read and review code
|
||||
// DEPRECATED: use genericiooptions.IOSTREAMS
|
||||
type IOStreams struct {
|
||||
// In think, os.Stdin
|
||||
In io.Reader
|
||||
// Out think, os.Stdout
|
||||
Out io.Writer
|
||||
// ErrOut think, os.Stderr
|
||||
ErrOut io.Writer
|
||||
}
|
||||
"k8s.io/cli-runtime/pkg/genericiooptions"
|
||||
)
|
||||
|
||||
// NewTestIOStreams returns a valid IOStreams and in, out, errout buffers for unit tests
|
||||
// DEPRECATED: use genericiooptions.NewTestIOStreams
|
||||
func NewTestIOStreams() (IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
|
||||
func NewTestIOStreams() (genericiooptions.IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
|
||||
in := &bytes.Buffer{}
|
||||
out := &bytes.Buffer{}
|
||||
errOut := &bytes.Buffer{}
|
||||
|
||||
return IOStreams{
|
||||
return genericiooptions.IOStreams{
|
||||
In: in,
|
||||
Out: out,
|
||||
ErrOut: errOut,
|
||||
@ -50,9 +39,9 @@ func NewTestIOStreams() (IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer)
|
||||
|
||||
// NewTestIOStreamsDiscard returns a valid IOStreams that just discards
|
||||
// DEPRECATED: use genericiooptions.NewTestIOStreamsDiscard
|
||||
func NewTestIOStreamsDiscard() IOStreams {
|
||||
func NewTestIOStreamsDiscard() genericiooptions.IOStreams {
|
||||
in := &bytes.Buffer{}
|
||||
return IOStreams{
|
||||
return genericiooptions.IOStreams{
|
||||
In: in,
|
||||
Out: ioutil.Discard,
|
||||
ErrOut: ioutil.Discard,
|
||||
|
Loading…
Reference in New Issue
Block a user