Skip to content

Refactored table rendering codes to support updated tablewriter v1.0.7 #20893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/addons_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var printAddonsList = func(cc *config.ClusterConfig, printDocs bool) {

table := tablewriter.NewWriter(os.Stdout)
table.SetAutoFormatHeaders(true)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetBorder(true)
table.SetCenterSeparator("|")

// Create table header
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func printAddonImagesTable(addon string) {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Image Name", "Default Image", "Default Registry"})
table.SetAutoFormatHeaders(true)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetBorder(true)
table.SetCenterSeparator("|")

for imageName, defaultImage := range conf.Images {
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func renderProfilesTable(ps [][]string) {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status", "Nodes", "Active Profile", "Active Kubecontext"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetBorder(true)
table.SetCenterSeparator("|")
table.AppendBulk(ps)
table.Render()
Expand Down
2 changes: 1 addition & 1 deletion hack/benchmark/time-to-k8s/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func outputMarkdownTable(categories []plotter.Values, totals []float64, names []
t.SetAutoWrapText(false)
t.SetHeader(headers)
t.SetAutoFormatHeaders(false)
t.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
t.SetBorder(true)
t.SetCenterSeparator("|")
t.AppendBulk(c)
t.Render()
Expand Down
2 changes: 1 addition & 1 deletion hack/benchmark/time-to-k8s/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func cpuMarkdownTable(categories []plotter.Values, names []string) {
t.SetAutoWrapText(false)
t.SetHeader(headers)
t.SetAutoFormatHeaders(false)
t.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
t.SetBorder(true)
t.SetCenterSeparator("|")
t.AppendBulk(c)
t.Render()
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/audit/row.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func rowsToASCIITable(rows []row, headers []string) string {
t := tablewriter.NewWriter(b)
t.SetHeader(headers)
t.SetAutoFormatHeaders(false)
t.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
t.SetBorder(true)
t.SetCenterSeparator("|")
t.AppendBulk(c)
t.Render()
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/machine/cache_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,8 @@ func renderImagesTable(images [][]string) {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Image", "Tag", "Image ID", "Size"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetAlignment(tablewriter.ALIGN_LEFT)
table.SetBorder(true)
table.SetAlignment(0)
table.SetCenterSeparator("|")
table.AppendBulk(images)
table.Render()
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/perf/result_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}
}
t := tablewriter.NewWriter(os.Stdout)
t.SetHeader([]string{"Command", binaries[0].Name(), binaries[1].Name()})
t.SetHeaders([]string{"Command", binaries[0].Name(), binaries[1].Name()})

Check failure on line 92 in pkg/minikube/perf/result_manager.go

View workflow job for this annotation

GitHub Actions / lint

t.SetHeaders undefined (type *tablewriter.Table has no field or method SetHeaders) (typecheck)

Check failure on line 92 in pkg/minikube/perf/result_manager.go

View workflow job for this annotation

GitHub Actions / lint

t.SetHeaders undefined (type *tablewriter.Table has no field or method SetHeaders)) (typecheck)

Check failure on line 92 in pkg/minikube/perf/result_manager.go

View workflow job for this annotation

GitHub Actions / unit_test

t.SetHeaders undefined (type *tablewriter.Table has no field or method SetHeaders)
for _, v := range table {
// Add warning sign if PR average is 5 seconds higher than average at HEAD
if len(v) >= 3 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func OptionallyHTTPSFormattedURLString(bareURLString string, https bool) (string
func PrintServiceList(writer io.Writer, data [][]string) {
table := tablewriter.NewWriter(writer)
table.SetHeader([]string{"Namespace", "Name", "Target Port", "URL"})
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetBorder(true)
table.SetCenterSeparator("|")
table.AppendBulk(data)
table.Render()
Expand Down
Loading