diff --git a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go index b8211e529c5ca..3ba2366041a22 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go +++ b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter.go @@ -32,8 +32,6 @@ import ( "k8s.io/apimachinery/pkg/watch" ) -const maxStringLength = 100 - var _ ResourcePrinter = &HumanReadablePrinter{} type printHandler struct { @@ -214,12 +212,6 @@ func printTable(table *metav1.Table, output io.Writer, options PrintOptions) err case string: print := val more := 0 - // cut to maxStringLength - if len(val) > maxStringLength { - more = len(print) - maxStringLength - print = print[:maxStringLength] - } - // and also check for newlines newline := strings.Index(print, "\n") if newline >= 0 { more = more + len(print) - newline diff --git a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go index 770067cf50d74..ab14679dcbec9 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go +++ b/staging/src/k8s.io/cli-runtime/pkg/printers/tableprinter_test.go @@ -741,34 +741,6 @@ func TestStringPrinting(t *testing.T) { }, expected: `NAME AGE DESCRIPTION test1 20h This is first line + 56 more... -`, - }, - // lengthy string - { - columns: []metav1.TableColumnDefinition{ - {Name: "Name", Type: "string"}, - {Name: "Age", Type: "string"}, - {Name: "Description", Type: "string"}, - }, - rows: []metav1.TableRow{ - {Cells: []interface{}{"test1", "20h", "This is first line which is long and goes for on and on and on an on and on and on and on and on and on and on and on and on and on and on"}}, - }, - expected: `NAME AGE DESCRIPTION -test1 20h This is first line which is long and goes for on and on and on an on and on and on and on and on and + 38 more... -`, - }, - // lengthy string + newline - { - columns: []metav1.TableColumnDefinition{ - {Name: "Name", Type: "string"}, - {Name: "Age", Type: "string"}, - {Name: "Description", Type: "string"}, - }, - rows: []metav1.TableRow{ - {Cells: []interface{}{"test1", "20h", "This is first\n line which is long and goes for on and on and on an on and on and on and on and on and on and on and on and on and on and on"}}, - }, - expected: `NAME AGE DESCRIPTION -test1 20h This is first + 126 more... `, }, }