Skip to content

Commit 9ac05f1

Browse files
committed
bump tablewriter version
1 parent 71e01be commit 9ac05f1

File tree

7 files changed

+49
-39
lines changed

7 files changed

+49
-39
lines changed

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/google/cel-go v0.23.2
2222
github.com/google/go-cmp v0.7.0
2323
github.com/google/go-github/v53 v53.2.0
24-
github.com/olekukonko/tablewriter v0.0.5
24+
github.com/olekukonko/tablewriter v1.0.7
2525
github.com/onsi/ginkgo/v2 v2.23.4
2626
github.com/onsi/gomega v1.37.0
2727
github.com/pkg/errors v0.9.1
@@ -101,14 +101,16 @@ require (
101101
github.com/mailru/easyjson v0.7.7 // indirect
102102
github.com/mattn/go-colorable v0.1.13 // indirect
103103
github.com/mattn/go-isatty v0.0.20 // indirect
104-
github.com/mattn/go-runewidth v0.0.14 // indirect
104+
github.com/mattn/go-runewidth v0.0.16 // indirect
105105
github.com/mitchellh/copystructure v1.2.0 // indirect
106106
github.com/mitchellh/reflectwalk v1.0.2 // indirect
107107
github.com/moby/spdystream v0.5.0 // indirect
108108
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
109109
github.com/modern-go/reflect2 v1.0.2 // indirect
110110
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
111111
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
112+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect
113+
github.com/olekukonko/ll v0.0.8 // indirect
112114
github.com/opencontainers/go-digest v1.0.0 // indirect
113115
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
114116
github.com/prometheus/client_model v0.6.1 // indirect

go.sum

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
229229
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
230230
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
231231
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
232-
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
233-
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
234-
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
232+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
233+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
235234
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
236235
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
237236
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
@@ -247,8 +246,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
247246
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
248247
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
249248
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
250-
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
251-
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
249+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 h1:r3FaAI0NZK3hSmtTDrBVREhKULp8oUeqLT5Eyl2mSPo=
250+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
251+
github.com/olekukonko/ll v0.0.8 h1:sbGZ1Fx4QxJXEqL/6IG8GEFnYojUSQ45dJVwN2FH2fc=
252+
github.com/olekukonko/ll v0.0.8/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
253+
github.com/olekukonko/tablewriter v1.0.7 h1:HCC2e3MM+2g72M81ZcJU11uciw6z/p82aEnm4/ySDGw=
254+
github.com/olekukonko/tablewriter v1.0.7/go.mod h1:H428M+HzoUXC6JU2Abj9IT9ooRmdq9CxuDmKMtrOCMs=
252255
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
253256
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
254257
github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=

hack/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ require (
118118
github.com/mailru/easyjson v0.7.7 // indirect
119119
github.com/mattn/go-colorable v0.1.13 // indirect
120120
github.com/mattn/go-isatty v0.0.20 // indirect
121-
github.com/mattn/go-runewidth v0.0.15 // indirect
121+
github.com/mattn/go-runewidth v0.0.16 // indirect
122122
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
123123
github.com/modern-go/reflect2 v1.0.2 // indirect
124124
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect

hack/tools/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
240240
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
241241
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
242242
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
243+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
243244
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
244245
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
245246
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=

internal/util/tree/tree.go

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/fatih/color"
2929
"github.com/gobuffalo/flect"
3030
"github.com/olekukonko/tablewriter"
31+
"github.com/olekukonko/tablewriter/tw"
3132
corev1 "k8s.io/api/core/v1"
3233
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3334
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -66,7 +67,7 @@ var (
6667
func PrintObjectTree(tree *tree.ObjectTree, w io.Writer) {
6768
// Creates the output table
6869
tbl := tablewriter.NewWriter(w)
69-
tbl.SetHeader([]string{"NAME", "REPLICAS", "AVAILABLE", "READY", "UP TO DATE", "STATUS", "REASON", "SINCE", "MESSAGE"})
70+
tbl.Header([]string{"NAME", "REPLICAS", "AVAILABLE", "READY", "UP TO DATE", "STATUS", "REASON", "SINCE", "MESSAGE"})
7071

7172
formatTableTree(tbl)
7273
// Add row for the root object, the cluster, and recursively for all the nodes representing the cluster status.
@@ -81,7 +82,7 @@ func PrintObjectTree(tree *tree.ObjectTree, w io.Writer) {
8182
func PrintObjectTreeV1Beta1(tree *tree.ObjectTree) {
8283
// Creates the output table
8384
tbl := tablewriter.NewWriter(os.Stdout)
84-
tbl.SetHeader([]string{"NAME", "READY", "SEVERITY", "REASON", "SINCE", "MESSAGE"})
85+
tbl.Header([]string{"NAME", "READY", "SEVERITY", "REASON", "SINCE", "MESSAGE"})
8586

8687
formatTableTreeV1Beta1(tbl)
8788
// Add row for the root object, the cluster, and recursively for all the nodes representing the cluster status.
@@ -93,32 +94,30 @@ func PrintObjectTreeV1Beta1(tree *tree.ObjectTree) {
9394

9495
// formats the table with required attributes.
9596
func formatTableTree(tbl *tablewriter.Table) {
96-
tbl.SetAutoWrapText(false)
97-
tbl.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
98-
tbl.SetAlignment(tablewriter.ALIGN_LEFT)
99-
100-
tbl.SetCenterSeparator("")
101-
tbl.SetRowSeparator("")
102-
103-
tbl.SetHeaderLine(false)
104-
tbl.SetTablePadding(" ")
105-
tbl.SetNoWhiteSpace(true)
97+
tbl.Options(
98+
tablewriter.WithRowAutoWrap(tw.WrapNone),
99+
tablewriter.WithHeaderAlignment(tw.AlignLeft),
100+
tablewriter.WithRendition(tw.Rendition{
101+
Borders: tw.BorderNone,
102+
Settings: tw.Settings{
103+
Separators: tw.SeparatorsNone,
104+
}}),
105+
tablewriter.WithPadding(tw.Padding{Right: " "}),
106+
)
106107
}
107108

108109
// formats the table with required attributes.
109110
func formatTableTreeV1Beta1(tbl *tablewriter.Table) {
110-
tbl.SetAutoWrapText(false)
111-
tbl.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
112-
tbl.SetAlignment(tablewriter.ALIGN_LEFT)
113-
114-
tbl.SetCenterSeparator("")
115-
tbl.SetColumnSeparator("")
116-
tbl.SetRowSeparator("")
117-
118-
tbl.SetHeaderLine(false)
119-
tbl.SetBorder(false)
120-
tbl.SetTablePadding(" ")
121-
tbl.SetNoWhiteSpace(true)
111+
tbl.Options(
112+
tablewriter.WithRowAutoWrap(tw.WrapNone),
113+
tablewriter.WithHeaderAlignment(tw.AlignLeft),
114+
tablewriter.WithRendition(tw.Rendition{
115+
Borders: tw.BorderNone,
116+
Settings: tw.Settings{
117+
Separators: tw.SeparatorsNone,
118+
}}),
119+
tablewriter.WithPadding(tw.Padding{Right: " "}),
120+
)
122121
}
123122

124123
// addObjectRow add a row for a given object, and recursively for all the object's children.

test/go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ require (
9898
github.com/mailru/easyjson v0.7.7 // indirect
9999
github.com/mattn/go-colorable v0.1.13 // indirect
100100
github.com/mattn/go-isatty v0.0.20 // indirect
101-
github.com/mattn/go-runewidth v0.0.14 // indirect
101+
github.com/mattn/go-runewidth v0.0.16 // indirect
102102
github.com/mitchellh/copystructure v1.2.0 // indirect
103103
github.com/mitchellh/reflectwalk v1.0.2 // indirect
104104
github.com/moby/docker-image-spec v1.3.1 // indirect
@@ -109,7 +109,9 @@ require (
109109
github.com/morikuni/aec v1.0.0 // indirect
110110
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
111111
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
112-
github.com/olekukonko/tablewriter v0.0.5 // indirect
112+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect
113+
github.com/olekukonko/ll v0.0.8 // indirect
114+
github.com/olekukonko/tablewriter v1.0.7 // indirect
113115
github.com/opencontainers/go-digest v1.0.0 // indirect
114116
github.com/opencontainers/image-spec v1.0.2 // indirect
115117
github.com/pelletier/go-toml v1.9.5 // indirect

test/go.sum

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
194194
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
195195
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
196196
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
197-
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
198-
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
199-
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
197+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
198+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
200199
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
201200
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
202201
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
@@ -222,8 +221,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
222221
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
223222
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
224223
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
225-
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
226-
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
224+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 h1:r3FaAI0NZK3hSmtTDrBVREhKULp8oUeqLT5Eyl2mSPo=
225+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
226+
github.com/olekukonko/ll v0.0.8 h1:sbGZ1Fx4QxJXEqL/6IG8GEFnYojUSQ45dJVwN2FH2fc=
227+
github.com/olekukonko/ll v0.0.8/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
228+
github.com/olekukonko/tablewriter v1.0.7 h1:HCC2e3MM+2g72M81ZcJU11uciw6z/p82aEnm4/ySDGw=
229+
github.com/olekukonko/tablewriter v1.0.7/go.mod h1:H428M+HzoUXC6JU2Abj9IT9ooRmdq9CxuDmKMtrOCMs=
227230
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
228231
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
229232
github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=

0 commit comments

Comments
 (0)