diff --git a/go.mod b/go.mod
index 32e663d82ac..84912a860fe 100644
--- a/go.mod
+++ b/go.mod
@@ -25,7 +25,7 @@ require (
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.5.9
github.com/gorilla/mux v1.8.0
- github.com/jedib0t/go-pretty/v6 v6.4.3
+ github.com/jedib0t/go-pretty/v6 v6.4.7
github.com/kubernetes-sigs/service-catalog v0.3.1
github.com/mattn/go-colorable v0.1.13
github.com/olekukonko/tablewriter v0.0.5
diff --git a/go.sum b/go.sum
index 8f9f61b4a71..f0d5198d8e8 100644
--- a/go.sum
+++ b/go.sum
@@ -765,8 +765,8 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
-github.com/jedib0t/go-pretty/v6 v6.4.3 h1:2n9BZ0YQiXGESUSR+6FLg0WWWE80u+mIz35f0uHWcIE=
-github.com/jedib0t/go-pretty/v6 v6.4.3/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI=
+github.com/jedib0t/go-pretty/v6 v6.4.7 h1:lwiTJr1DEkAgzljsUsORmWsVn5MQjt1BPJdPCtJ6KXE=
+github.com/jedib0t/go-pretty/v6 v6.4.7/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render.go
index 8a13df54e73..ca4bc9908c5 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render.go
@@ -365,15 +365,16 @@ func (t *Table) renderRowsHeader(out *strings.Builder) {
func (t *Table) renderTitle(out *strings.Builder) {
if t.title != "" {
colors := t.style.Title.Colors
+ colorsBorder := t.getBorderColors(renderHint{isTitleRow: true})
rowLength := t.maxRowLength
if t.allowedRowLength != 0 && t.allowedRowLength < rowLength {
rowLength = t.allowedRowLength
}
if t.style.Options.DrawBorder {
lenBorder := rowLength - text.RuneWidthWithoutEscSequences(t.style.Box.TopLeft+t.style.Box.TopRight)
- out.WriteString(colors.Sprint(t.style.Box.TopLeft))
- out.WriteString(colors.Sprint(text.RepeatAndTrim(t.style.Box.MiddleHorizontal, lenBorder)))
- out.WriteString(colors.Sprint(t.style.Box.TopRight))
+ out.WriteString(colorsBorder.Sprint(t.style.Box.TopLeft))
+ out.WriteString(colorsBorder.Sprint(text.RepeatAndTrim(t.style.Box.MiddleHorizontal, lenBorder)))
+ out.WriteString(colorsBorder.Sprint(t.style.Box.TopRight))
}
lenText := rowLength - text.RuneWidthWithoutEscSequences(t.style.Box.PaddingLeft+t.style.Box.PaddingRight)
@@ -382,12 +383,12 @@ func (t *Table) renderTitle(out *strings.Builder) {
}
titleText := text.WrapText(t.title, lenText)
for _, titleLine := range strings.Split(titleText, "\n") {
- t.renderTitleLine(out, lenText, titleLine, colors)
+ t.renderTitleLine(out, lenText, titleLine, colors, colorsBorder)
}
}
}
-func (t *Table) renderTitleLine(out *strings.Builder, lenText int, titleLine string, colors text.Colors) {
+func (t *Table) renderTitleLine(out *strings.Builder, lenText int, titleLine string, colors text.Colors, colorsBorder text.Colors) {
titleLine = strings.TrimSpace(titleLine)
titleLine = t.style.Title.Format.Apply(titleLine)
titleLine = t.style.Title.Align.Apply(titleLine, lenText)
@@ -397,10 +398,10 @@ func (t *Table) renderTitleLine(out *strings.Builder, lenText int, titleLine str
out.WriteRune('\n')
}
if t.style.Options.DrawBorder {
- out.WriteString(colors.Sprint(t.style.Box.Left))
+ out.WriteString(colorsBorder.Sprint(t.style.Box.Left))
}
out.WriteString(colors.Sprint(titleLine))
if t.style.Options.DrawBorder {
- out.WriteString(colors.Sprint(t.style.Box.Right))
+ out.WriteString(colorsBorder.Sprint(t.style.Box.Right))
}
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_hint.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_hint.go
index e585389da64..e46cdc845b0 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_hint.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_hint.go
@@ -12,10 +12,15 @@ type renderHint struct {
isLastLineOfRow bool // last-line of the current row?
isLastRow bool // last-row of header/footer/regular-rows?
isSeparatorRow bool // separator row?
+ isTitleRow bool // title row?
rowLineNumber int // the line number for a multi-line row
rowNumber int // the row number/index
}
+func (h *renderHint) isBorderOrSeparator() bool {
+ return h.isBorderTop || h.isSeparatorRow || h.isBorderBottom
+}
+
func (h *renderHint) isRegularRow() bool {
return !h.isHeaderRow && !h.isFooterRow
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
index 10a73252705..bf712ec54c3 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
@@ -112,7 +112,7 @@ func (t *Table) htmlRenderColumn(out *strings.Builder, colStr string) {
out.WriteString(colStr)
}
-func (t *Table) htmlRenderColumnAttributes(out *strings.Builder, row rowStr, colIdx int, hint renderHint) {
+func (t *Table) htmlRenderColumnAttributes(out *strings.Builder, colIdx int, hint renderHint) {
// determine the HTML "align"/"valign" property values
align := t.getAlign(colIdx, hint).HTMLProperty()
vAlign := t.getVAlign(colIdx, hint).HTMLProperty()
@@ -161,7 +161,7 @@ func (t *Table) htmlRenderRow(out *strings.Builder, row rowStr, hint renderHint)
// write the row
out.WriteString(" <")
out.WriteString(colTagName)
- t.htmlRenderColumnAttributes(out, row, colIdx, hint)
+ t.htmlRenderColumnAttributes(out, colIdx, hint)
out.WriteString(">")
if len(colStr) == 0 {
out.WriteString(t.style.HTML.EmptyColumn)
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_init.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_init.go
index c6fd97c9a1d..917879b96d6 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_init.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_init.go
@@ -43,12 +43,8 @@ func (t *Table) analyzeAndStringifyColumn(colIdx int, col interface{}, hint rend
} else {
colStr = fmt.Sprint(col)
}
- if strings.Contains(colStr, "\t") {
- colStr = strings.Replace(colStr, "\t", " ", -1)
- }
- if strings.Contains(colStr, "\r") {
- colStr = strings.Replace(colStr, "\r", "", -1)
- }
+ colStr = strings.ReplaceAll(colStr, "\t", " ")
+ colStr = strings.ReplaceAll(colStr, "\r", "")
return fmt.Sprintf("%s%s", t.style.Format.Direction.Modifier(), colStr)
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
index 127adcdec3f..1a8c488f481 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
@@ -54,12 +54,8 @@ func (t *Table) markdownRenderRow(out *strings.Builder, row rowStr, hint renderH
colStr = row[colIdx]
}
out.WriteRune(' ')
- if strings.Contains(colStr, "|") {
- colStr = strings.Replace(colStr, "|", "\\|", -1)
- }
- if strings.Contains(colStr, "\n") {
- colStr = strings.Replace(colStr, "\n", "
", -1)
- }
+ colStr = strings.ReplaceAll(colStr, "|", "\\|")
+ colStr = strings.ReplaceAll(colStr, "\n", "
")
out.WriteString(colStr)
out.WriteRune(' ')
}
@@ -94,7 +90,6 @@ func (t *Table) markdownRenderRows(out *strings.Builder, rows []rowStr, hint ren
func (t *Table) markdownRenderRowsFooter(out *strings.Builder) {
t.markdownRenderRows(out, t.rowsFooter, renderHint{isFooterRow: true})
-
}
func (t *Table) markdownRenderRowsHeader(out *strings.Builder) {
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/style.go b/vendor/github.com/jedib0t/go-pretty/v6/table/style.go
index 2c1795c4208..cb850e88b43 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/style.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/style.go
@@ -533,11 +533,13 @@ var (
// ColorOptions defines the ANSI colors to use for parts of the Table.
type ColorOptions struct {
- IndexColumn text.Colors // index-column colors (row #, etc.)
+ Border text.Colors // borders (if nil, uses one of the below)
Footer text.Colors // footer row(s) colors
Header text.Colors // header row(s) colors
+ IndexColumn text.Colors // index-column colors (row #, etc.)
Row text.Colors // regular row(s) colors
RowAlternate text.Colors // regular row(s) colors for the even-numbered rows
+ Separator text.Colors // separators (if nil, uses one of the above)
}
var (
@@ -552,18 +554,18 @@ var (
// ColorOptionsBlackOnBlueWhite renders Black text on Blue/White background.
ColorOptionsBlackOnBlueWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiBlue, text.FgBlack},
Footer: text.Colors{text.BgBlue, text.FgBlack},
Header: text.Colors{text.BgHiBlue, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiBlue, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
// ColorOptionsBlackOnCyanWhite renders Black text on Cyan/White background.
ColorOptionsBlackOnCyanWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiCyan, text.FgBlack},
Footer: text.Colors{text.BgCyan, text.FgBlack},
Header: text.Colors{text.BgHiCyan, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiCyan, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
@@ -571,9 +573,9 @@ var (
// ColorOptionsBlackOnGreenWhite renders Black text on Green/White
// background.
ColorOptionsBlackOnGreenWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiGreen, text.FgBlack},
Footer: text.Colors{text.BgGreen, text.FgBlack},
Header: text.Colors{text.BgHiGreen, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiGreen, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
@@ -581,18 +583,18 @@ var (
// ColorOptionsBlackOnMagentaWhite renders Black text on Magenta/White
// background.
ColorOptionsBlackOnMagentaWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiMagenta, text.FgBlack},
Footer: text.Colors{text.BgMagenta, text.FgBlack},
Header: text.Colors{text.BgHiMagenta, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiMagenta, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
// ColorOptionsBlackOnRedWhite renders Black text on Red/White background.
ColorOptionsBlackOnRedWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiRed, text.FgBlack},
Footer: text.Colors{text.BgRed, text.FgBlack},
Header: text.Colors{text.BgHiRed, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiRed, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
@@ -600,27 +602,27 @@ var (
// ColorOptionsBlackOnYellowWhite renders Black text on Yellow/White
// background.
ColorOptionsBlackOnYellowWhite = ColorOptions{
- IndexColumn: text.Colors{text.BgHiYellow, text.FgBlack},
Footer: text.Colors{text.BgYellow, text.FgBlack},
Header: text.Colors{text.BgHiYellow, text.FgBlack},
+ IndexColumn: text.Colors{text.BgHiYellow, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
RowAlternate: text.Colors{text.BgWhite, text.FgBlack},
}
// ColorOptionsBlueWhiteOnBlack renders Blue/White text on Black background.
ColorOptionsBlueWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiBlue, text.BgHiBlack},
Footer: text.Colors{text.FgBlue, text.BgHiBlack},
Header: text.Colors{text.FgHiBlue, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiBlue, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
// ColorOptionsCyanWhiteOnBlack renders Cyan/White text on Black background.
ColorOptionsCyanWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiCyan, text.BgHiBlack},
Footer: text.Colors{text.FgCyan, text.BgHiBlack},
Header: text.Colors{text.FgHiCyan, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiCyan, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
@@ -628,9 +630,9 @@ var (
// ColorOptionsGreenWhiteOnBlack renders Green/White text on Black
// background.
ColorOptionsGreenWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiGreen, text.BgHiBlack},
Footer: text.Colors{text.FgGreen, text.BgHiBlack},
Header: text.Colors{text.FgHiGreen, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiGreen, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
@@ -638,18 +640,18 @@ var (
// ColorOptionsMagentaWhiteOnBlack renders Magenta/White text on Black
// background.
ColorOptionsMagentaWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiMagenta, text.BgHiBlack},
Footer: text.Colors{text.FgMagenta, text.BgHiBlack},
Header: text.Colors{text.FgHiMagenta, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiMagenta, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
// ColorOptionsRedWhiteOnBlack renders Red/White text on Black background.
ColorOptionsRedWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiRed, text.BgHiBlack},
Footer: text.Colors{text.FgRed, text.BgHiBlack},
Header: text.Colors{text.FgHiRed, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiRed, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
@@ -657,9 +659,9 @@ var (
// ColorOptionsYellowWhiteOnBlack renders Yellow/White text on Black
// background.
ColorOptionsYellowWhiteOnBlack = ColorOptions{
- IndexColumn: text.Colors{text.FgHiYellow, text.BgHiBlack},
Footer: text.Colors{text.FgYellow, text.BgHiBlack},
Header: text.Colors{text.FgHiYellow, text.BgHiBlack},
+ IndexColumn: text.Colors{text.FgHiYellow, text.BgHiBlack},
Row: text.Colors{text.FgHiWhite, text.BgBlack},
RowAlternate: text.Colors{text.FgWhite, text.BgBlack},
}
@@ -673,14 +675,12 @@ type FormatOptions struct {
Row text.Format // (data) row(s) text format
}
-var (
- // FormatOptionsDefault defines sensible formatting options.
- FormatOptionsDefault = FormatOptions{
- Footer: text.FormatUpper,
- Header: text.FormatUpper,
- Row: text.FormatDefault,
- }
-)
+// FormatOptionsDefault defines sensible formatting options.
+var FormatOptionsDefault = FormatOptions{
+ Footer: text.FormatUpper,
+ Header: text.FormatUpper,
+ Row: text.FormatDefault,
+}
// HTMLOptions defines the global options to control HTML rendering.
type HTMLOptions struct {
@@ -690,19 +690,21 @@ type HTMLOptions struct {
Newline string // string to replace "\n" characters with
}
-var (
- // DefaultHTMLOptions defines sensible HTML rendering defaults.
- DefaultHTMLOptions = HTMLOptions{
- CSSClass: DefaultHTMLCSSClass,
- EmptyColumn: " ",
- EscapeText: true,
- Newline: "
",
- }
-)
+// DefaultHTMLOptions defines sensible HTML rendering defaults.
+var DefaultHTMLOptions = HTMLOptions{
+ CSSClass: DefaultHTMLCSSClass,
+ EmptyColumn: " ",
+ EscapeText: true,
+ Newline: "
",
+}
// Options defines the global options that determine how the Table is
// rendered.
type Options struct {
+ // DoNotColorBordersAndSeparators disables coloring all the borders and row
+ // or column separators.
+ DoNotColorBordersAndSeparators bool
+
// DrawBorder enables or disables drawing the border around the Table.
// Example of a table where it is disabled:
// # │ FIRST NAME │ LAST NAME │ SALARY │
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/table.go b/vendor/github.com/jedib0t/go-pretty/v6/table/table.go
index 297de86bf48..1801c1c51a9 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/table.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/table.go
@@ -32,13 +32,13 @@ func (row rowStr) areEqual(colIdx1 int, colIdx2 int) bool {
return colIdx1 >= 0 && colIdx2 < len(row) && row[colIdx1] == row[colIdx2]
}
-// Table helps print a 2-dimensional array in a human readable pretty-table.
+// Table helps print a 2-dimensional array in a human-readable pretty-table.
type Table struct {
// allowedRowLength is the max allowed length for a row (or line of output)
allowedRowLength int
// enable automatic indexing of the rows and columns like a spreadsheet?
autoIndex bool
- // autoIndexVIndexMaxLength denotes the length in chars for the last rownum
+ // autoIndexVIndexMaxLength denotes the length in chars for the last row
autoIndexVIndexMaxLength int
// caption stores the text to be rendered just below the table; and doesn't
// get used when rendered as a CSV
@@ -228,7 +228,7 @@ func (t *Table) SetColumnConfigs(configs []ColumnConfig) {
t.columnConfigs = configs
}
-// SetHTMLCSSClass sets the the HTML CSS Class to use on the