Commit 41b84b7f authored by Sean Sullivan's avatar Sean Sullivan

Unexport PrintTable function

parent b3a73f76
...@@ -97,7 +97,7 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er ...@@ -97,7 +97,7 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er
if err := decorateTable(table, localOptions); err != nil { if err := decorateTable(table, localOptions); err != nil {
return err return err
} }
return PrintTable(table, output, localOptions) return printTable(table, output, localOptions)
} }
// Case 2: Parameter "obj" is not a table; search for a handler to print it. // Case 2: Parameter "obj" is not a table; search for a handler to print it.
...@@ -133,10 +133,10 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er ...@@ -133,10 +133,10 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er
return nil return nil
} }
// PrintTable prints a table to the provided output respecting the filtering rules for options // printTable prints a table to the provided output respecting the filtering rules for options
// for wide columns and filtered rows. It filters out rows that are Completed. You should call // for wide columns and filtered rows. It filters out rows that are Completed. You should call
// decorateTable if you receive a table from a remote server before calling PrintTable. // decorateTable if you receive a table from a remote server before calling printTable.
func PrintTable(table *metav1beta1.Table, output io.Writer, options PrintOptions) error { func printTable(table *metav1beta1.Table, output io.Writer, options PrintOptions) error {
if !options.NoHeaders { if !options.NoHeaders {
// avoid printing headers if we have no rows to display // avoid printing headers if we have no rows to display
if len(table.Rows) == 0 { if len(table.Rows) == 0 {
......
...@@ -165,7 +165,8 @@ var _ = SIGDescribe("Servers with support for Table transformation", func() { ...@@ -165,7 +165,8 @@ var _ = SIGDescribe("Servers with support for Table transformation", func() {
func printTable(table *metav1beta1.Table) string { func printTable(table *metav1beta1.Table) string {
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
tw := tabwriter.NewWriter(buf, 5, 8, 1, ' ', 0) tw := tabwriter.NewWriter(buf, 5, 8, 1, ' ', 0)
err := printers.PrintTable(table, tw, printers.PrintOptions{}) printer := printers.NewTablePrinter(printers.PrintOptions{})
err := printer.PrintObj(table, tw)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "failed to print table: %+v", table) gomega.Expect(err).NotTo(gomega.HaveOccurred(), "failed to print table: %+v", table)
tw.Flush() tw.Flush()
return buf.String() return buf.String()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment