Skip to content

Refactor table rendering #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

Merged
merged 25 commits into from
Jul 21, 2025
Merged

Refactor table rendering #20893

merged 25 commits into from
Jul 21, 2025

Conversation

Victorthedev
Copy link
Contributor

@Victorthedev Victorthedev commented Jun 5, 2025

Bumping the tablewriter library and refresh the looks of the Tables from ASCII to newer look

Before This PR

$ mk profile list
+---------+--------+---------+---------------+---------+--------+-------+----------------+--------------------+
| PROFILE | DRIVER | RUNTIME |      IP       | VERSION | STATUS | NODES | ACTIVE PROFILE | ACTIVE KUBECONTEXT |
+---------+--------+---------+---------------+---------+--------+-------+----------------+--------------------+
| p1      | vfkit  | docker  | 192.168.106.7 | v1.33.1 | OK     | 1     |                |                    |
| p2      | vfkit  | docker  | 192.168.106.8 | v1.33.2 | OK     | 1     |                | *                  |
+---------+--------+---------+---------------+---------+--------+-------+----------------+--------------------+

After this PR

$ mk profile list
┌─────────┬────────┬─────────┬───────────────┬─────────┬────────┬───────┬────────────────┬────────────────────┐
│ PROFILE │ DRIVER │ RUNTIME │      IP       │ VERSION │ STATUS │ NODES │ ACTIVE PROFILE │ ACTIVE KUBECONTEXT │
├─────────┼────────┼─────────┼───────────────┼─────────┼────────┼───────┼────────────────┼────────────────────┤
│ p1      │ vfkit  │ docker  │ 192.168.106.7 │ v1.33.1 │ OK     │ 1     │                │                    │
│ p2      │ vfkit  │ docker  │ 192.168.106.8 │ v1.33.2 │ OK     │ 1     │                │ *                  │
└─────────┴────────┴─────────┴───────────────┴─────────┴────────┴───────┴────────────────┴────────────────────┘

This commit makes all necessary code changes to maintain compatibility with the new tablewriter version. The update includes several required modifications across multiple files.

Files modified:

  • cmd/minikube/cmd/config/images.go
  • cmd/minikube/cmd/config/addons_list.go
  • cmd/minikube/cmd/config/profile_list.go
  • hack/benchmark/time-to-k8s/chart.go
  • hack/benchmark/time-to-k8s/cpu.go
  • pkg/minikube/audit/row.go
  • pkg/minikube/machine/cache_images.go
  • pkg/minikube/perf/result_manager.go
  • pkg/minikube/service/service.go

Now #20878 can be merged.
Addresses #20879

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 5, 2025
@k8s-ci-robot k8s-ci-robot requested review from prezha and spowelljr June 5, 2025 15:54
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 5, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Victorthedev. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 5, 2025
@Victorthedev
Copy link
Contributor Author

@medyagh please review

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Victorthedev thank you for this PR, can you please share the output of a few minikube commands that use table

for example
./out/minikube start -p p1
./out/minikube start -p p2
./out/minikube start -p p3
minikube profile list

// deploy bunch of services and then
minikube service list

I wanna see if that changed the looks of it or not, and I wonder if we need to set the alignment to "Left" or not
because it seems like they changed the default alignment to be none

@medyagh
Copy link
Member

medyagh commented Jun 5, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 5, 2025
@medyagh
Copy link
Member

medyagh commented Jun 5, 2025

@Victorthedev also plz post output of minikube addons list
or any other thing that uses the tablewriter

@medyagh
Copy link
Member

medyagh commented Jun 5, 2025

@Victorthedev
Copy link
Contributor Author

@medyagh

Screenshot 2025-06-06 at 7 19 27 PM Screenshot 2025-06-06 at 8 12 10 PM Screenshot 2025-06-06 at 8 13 44 PM Screenshot 2025-06-06 at 8 15 23 PM

these are screenshots for ./out/minikube start -p p1
./out/minikube start -p p2
./out/minikube start -p p3
minikube profile list
minikube service list
minikube addons list

@Victorthedev
Copy link
Contributor Author

@Victorthedev plz check the builderrors

"https://storage.googleapis.com/minikube-builds/logs/20893/build.txt"

I just pushed a commit for pkg/minikube/perf/result_manager.go, thats the file with the error

@minikube-pr-bot

This comment has been minimized.

@medyagh
Copy link
Member

medyagh commented Jun 6, 2025

@Victorthedev thank you very much for the Screenshot, do you think we need Align Left? the "minikube service list" the port seems like it is aligned Right, maybe we can try with Align Let?

@medyagh
Copy link
Member

medyagh commented Jun 6, 2025

@Victorthedev can we also bump the go mod in the same PR to verify it works with new lib version?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 7, 2025
@Victorthedev
Copy link
Contributor Author

@Victorthedev can we also bump the go mod in the same PR to verify it works with new lib version?

@medyagh Done

@Victorthedev
Copy link
Contributor Author

@Victorthedev thank you very much for the Screenshot, do you think we need Align Left? the "minikube service list" the port seems like it is aligned Right, maybe we can try with Align Let?

@medyagh tried using table.SetColumnAlignment([]int{0, 0, 0, 0})

@Victorthedev
Copy link
Contributor Author

@Victorthedev: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-minikube-build 997d0b0 link true /test pull-minikube-build
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

/retest

@medyagh
Copy link
Member

medyagh commented Jun 8, 2025

@medyagh
Copy link
Member

medyagh commented Jun 9, 2025

@Victorthedev I think some of the Calls to the func may need to be updated to the new func signature

go build -tags "" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.36.0 -X k8s.io/minikube/pkg/version.isoVersion=v1.36.0-1749153077-20895 -X k8s.io/minikube/pkg/version.gitCommitID="9a257ad1c34dda0c77591f3f5270b92d55867bb3" -X k8s.io/minikube/pkg/version.storageProvisionerVersion=v5" -a -o out/minikube-linux-arm64 k8s.io/minikube/cmd/minikube
# k8s.io/minikube/pkg/minikube/audit
Error: pkg/minikube/audit/row.go:127:4: t.SetHeader undefined (type *tablewriter.Table has no field or method SetHeader)
Error: pkg/minikube/audit/row.go:128:4: t.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
Error: pkg/minikube/audit/row.go:129:4: t.SetBorder undefined (type *tablewriter.Table has no field or method SetBorder)
Error: pkg/minikube/audit/row.go:130:4: t.SetCenterSeparator undefined (type *tablewriter.Table has no field or method SetCenterSeparator)
Error: pkg/minikube/audit/row.go:131:4: t.AppendBulk undefined (type *tablewriter.Table has no field or method AppendBulk)
# k8s.io/minikube/pkg/minikube/machine
Error: pkg/minikube/machine/cache_images.go:848:8: table.SetHeader undefined (type *tablewriter.Table has no field or method SetHeader)
Error: pkg/minikube/machine/cache_images.go:849:8: table.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
Error: pkg/minikube/machine/cache_images.go:850:8: table.SetBorder undefined (type *tablewriter.Table has no field or method SetBorder)
Error: pkg/minikube/machine/cache_images.go:851:8: table.SetAlignment undefined (type *tablewriter.Table has no field or method SetAlignment)
Error: pkg/minikube/machine/cache_images.go:852:8: table.SetCenterSeparator undefined (type *tablewriter.Table has no field or method SetCenterSeparator)
Error: pkg/minikube/machine/cache_images.go:853:8: table.AppendBulk undefined (type *tablewriter.Table has no field or method AppendBulk)
make: *** [Makefile:281: out/minikube-linux-arm64] Error 1
make: *** [Makefile:278: out/minikube-linux-arm64] Error 2

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 10, 2025
@Victorthedev
Copy link
Contributor Author

@Victorthedev I think some of the Calls to the func may need to be updated to the new func signature

go build -tags "" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.36.0 -X k8s.io/minikube/pkg/version.isoVersion=v1.36.0-1749153077-20895 -X k8s.io/minikube/pkg/version.gitCommitID="9a257ad1c34dda0c77591f3f5270b92d55867bb3" -X k8s.io/minikube/pkg/version.storageProvisionerVersion=v5" -a -o out/minikube-linux-arm64 k8s.io/minikube/cmd/minikube
# k8s.io/minikube/pkg/minikube/audit
Error: pkg/minikube/audit/row.go:127:4: t.SetHeader undefined (type *tablewriter.Table has no field or method SetHeader)
Error: pkg/minikube/audit/row.go:128:4: t.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
Error: pkg/minikube/audit/row.go:129:4: t.SetBorder undefined (type *tablewriter.Table has no field or method SetBorder)
Error: pkg/minikube/audit/row.go:130:4: t.SetCenterSeparator undefined (type *tablewriter.Table has no field or method SetCenterSeparator)
Error: pkg/minikube/audit/row.go:131:4: t.AppendBulk undefined (type *tablewriter.Table has no field or method AppendBulk)
# k8s.io/minikube/pkg/minikube/machine
Error: pkg/minikube/machine/cache_images.go:848:8: table.SetHeader undefined (type *tablewriter.Table has no field or method SetHeader)
Error: pkg/minikube/machine/cache_images.go:849:8: table.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
Error: pkg/minikube/machine/cache_images.go:850:8: table.SetBorder undefined (type *tablewriter.Table has no field or method SetBorder)
Error: pkg/minikube/machine/cache_images.go:851:8: table.SetAlignment undefined (type *tablewriter.Table has no field or method SetAlignment)
Error: pkg/minikube/machine/cache_images.go:852:8: table.SetCenterSeparator undefined (type *tablewriter.Table has no field or method SetCenterSeparator)
Error: pkg/minikube/machine/cache_images.go:853:8: table.AppendBulk undefined (type *tablewriter.Table has no field or method AppendBulk)
make: *** [Makefile:281: out/minikube-linux-arm64] Error 1
make: *** [Makefile:278: out/minikube-linux-arm64] Error 2

Yes yes, I'm working on them

@spowelljr spowelljr removed their request for review June 26, 2025 23:51
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 21, 2025
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 51.0s    │ 51.9s                  │
│ enable ingress │ 15.0s    │ 15.0s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 52.0s 52.0s 51.4s 50.0s 49.4s
Times for minikube (PR 20893) start: 50.0s 55.4s 51.7s 51.3s 51.1s

Times for minikube ingress: 15.0s 15.0s 15.0s 15.0s 15.0s
Times for minikube (PR 20893) ingress: 15.0s 15.0s 15.0s 15.0s 15.0s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 22.2s    │ 23.7s                  │
│ enable ingress │ 24.6s    │ 12.7s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 22.4s 22.2s 22.4s 21.9s 22.1s
Times for minikube (PR 20893) start: 23.0s 24.9s 22.4s 22.7s 25.6s

Times for minikube ingress: 12.7s 72.7s 12.2s 12.7s 12.7s
Times for minikube (PR 20893) ingress: 12.2s 12.7s 12.7s 12.8s 12.8s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 21.9s    │ 22.7s                  │
│ enable ingress │ 26.0s    │ 22.9s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 24.1s 21.8s 21.7s 20.4s 21.6s
Times for minikube (PR 20893) start: 24.6s 20.8s 22.5s 24.2s 21.5s

Times for minikube ingress: 22.7s 22.7s 22.7s 39.2s 22.7s
Times for minikube (PR 20893) ingress: 23.2s 23.2s 22.7s 22.7s 22.7s

@medyagh
Copy link
Member

medyagh commented Jul 21, 2025

/lgtm

@medyagh medyagh self-requested a review July 21, 2025 23:17
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 21, 2025
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed my changes to this PR we can merge this

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, Victorthedev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@medyagh medyagh merged commit 958ecac into kubernetes:master Jul 21, 2025
29 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants