mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #60353 from WanLinghao/printer_clean
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. clean testprinter **What this PR does / why we need it**: testPrinter became useless after patch #60117 This patch clean it **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
a41483a8f5
@ -122,31 +122,6 @@ func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList)
|
||||
return pods, svc, rc
|
||||
}
|
||||
|
||||
type testPrinter struct {
|
||||
Objects []runtime.Object
|
||||
Err error
|
||||
GenericPrinter bool
|
||||
}
|
||||
|
||||
func (t *testPrinter) PrintObj(obj runtime.Object, out io.Writer) error {
|
||||
t.Objects = append(t.Objects, obj)
|
||||
fmt.Fprintf(out, "%#v", obj)
|
||||
return t.Err
|
||||
}
|
||||
|
||||
// TODO: implement HandledResources()
|
||||
func (t *testPrinter) HandledResources() []string {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
func (t *testPrinter) AfterPrint(output io.Writer, res string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *testPrinter) IsGeneric() bool {
|
||||
return t.GenericPrinter
|
||||
}
|
||||
|
||||
type testDescriber struct {
|
||||
Name, Namespace string
|
||||
Settings printers.DescriberSettings
|
||||
|
@ -82,31 +82,6 @@ func defaultClientConfig() *restclient.Config {
|
||||
}
|
||||
}
|
||||
|
||||
type testPrinter struct {
|
||||
Objects []runtime.Object
|
||||
Err error
|
||||
GenericPrinter bool
|
||||
}
|
||||
|
||||
func (t *testPrinter) PrintObj(obj runtime.Object, out io.Writer) error {
|
||||
t.Objects = append(t.Objects, obj)
|
||||
fmt.Fprintf(out, "%#v", obj)
|
||||
return t.Err
|
||||
}
|
||||
|
||||
// TODO: implement HandledResources()
|
||||
func (t *testPrinter) HandledResources() []string {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
func (t *testPrinter) AfterPrint(output io.Writer, res string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *testPrinter) IsGeneric() bool {
|
||||
return t.GenericPrinter
|
||||
}
|
||||
|
||||
func objBody(codec runtime.Codec, obj runtime.Object) io.ReadCloser {
|
||||
return ioutil.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(codec, obj))))
|
||||
}
|
||||
@ -246,7 +221,6 @@ func TestGetUnknownSchemaObject(t *testing.T) {
|
||||
|
||||
expected := []runtime.Object{cmdtesting.NewInternalType("", "", "foo")}
|
||||
actual := []runtime.Object{}
|
||||
//actual := tf.Printer.(*testPrinter).Objects
|
||||
if len(actual) != len(expected) {
|
||||
t.Fatalf("expected: %#v, but actual: %#v", expected, actual)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user