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

Conversation

Victorthedev
Copy link
Contributor

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

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 kubernetes#20878 can be merged.
Addresses kubernetes#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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Victorthedev
Once this PR has been reviewed and has the lgtm label, please assign medyagh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@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
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20893) |
+----------------+----------+---------------------+
| minikube start | 50.6s    | 49.0s               |
| enable ingress | 15.5s    | 15.1s               |
+----------------+----------+---------------------+

Times for minikube start: 52.2s 49.6s 50.6s 52.2s 48.4s
Times for minikube (PR 20893) start: 48.2s 48.4s 48.0s 50.6s 49.9s

Times for minikube (PR 20893) ingress: 15.5s 14.6s 16.0s 15.0s 14.5s
Times for minikube ingress: 15.5s 15.0s 16.0s 15.0s 16.0s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20893) |
+----------------+----------+---------------------+
| minikube start | 25.0s    | 23.4s               |
| enable ingress | 13.2s    | 13.0s               |
+----------------+----------+---------------------+

Times for minikube start: 25.8s 24.3s 22.8s 26.8s 25.3s
Times for minikube (PR 20893) start: 23.6s 21.2s 24.6s 23.6s 24.3s

Times for minikube ingress: 13.8s 13.3s 13.3s 13.3s 12.3s
Times for minikube (PR 20893) ingress: 12.8s 13.3s 13.3s 13.3s 12.3s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20893) |
+----------------+----------+---------------------+
| minikube start | 23.9s    | 22.3s               |
| enable ingress | 39.1s    | 39.2s               |
+----------------+----------+---------------------+

Times for minikube start: 23.7s 25.3s 25.4s 22.8s 22.4s
Times for minikube (PR 20893) start: 22.8s 20.3s 23.2s 22.4s 22.7s

Times for minikube ingress: 38.8s 38.9s 39.8s 38.8s 39.3s
Times for minikube (PR 20893) ingress: 39.8s 39.8s 38.8s 38.8s 38.8s

@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 the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

@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 54c498d 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.

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. I understand the commands that are listed here.

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants