minikube icon indicating copy to clipboard operation
minikube copied to clipboard

Refactored table rendering codes to support updated tablewriter v1.0.7

Open Victorthedev opened this issue 6 months ago • 19 comments

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

Victorthedev avatar Jun 05 '25 15:06 Victorthedev

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 avatar Jun 05 '25 15:06 k8s-ci-robot

@medyagh please review

Victorthedev avatar Jun 05 '25 15:06 Victorthedev

Can one of the admins verify this patch?

minikube-bot avatar Jun 05 '25 15:06 minikube-bot

/ok-to-test

medyagh avatar Jun 05 '25 17:06 medyagh

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

medyagh avatar Jun 05 '25 18:06 medyagh

@Victorthedev plz check the builderrors

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

medyagh avatar Jun 05 '25 18:06 medyagh

@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 avatar Jun 06 '25 19:06 Victorthedev

@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

Victorthedev avatar Jun 06 '25 19:06 Victorthedev

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

minikube-pr-bot avatar Jun 06 '25 20:06 minikube-pr-bot

@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 avatar Jun 06 '25 23:06 medyagh

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

medyagh avatar Jun 06 '25 23:06 medyagh

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

@medyagh Done

Victorthedev avatar Jun 07 '25 02:06 Victorthedev

@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 avatar Jun 07 '25 02:06 Victorthedev

@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

Victorthedev avatar Jun 07 '25 02:06 Victorthedev

@Victorthedev plz check the error https://storage.googleapis.com/minikube-builds/logs/20893/build.txt

medyagh avatar Jun 08 '25 01:06 medyagh

@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

medyagh avatar Jun 09 '25 18:06 medyagh

@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

Victorthedev avatar Jun 10 '25 08:06 Victorthedev

@Victorthedev let me know if you still working on this

medyagh avatar Jul 02 '25 17:07 medyagh

@Victorthedev let me know if you still working on this

Yes, i am. Sorry for the delay, i've had a busy schedule recently but i'm on it!

Victorthedev avatar Jul 02 '25 22:07 Victorthedev

@Victorthedev let me know if you still working on this

Yes, i am. Sorry for the delay, i've had a busy schedule recently but i'm on it!

@Victorthedev no worries let me if you have any questions

medyagh avatar Jul 08 '25 21:07 medyagh

@Victorthedev please check the build errors, it seems like the API has changed and needs to change the code

# k8s.io/minikube/pkg/minikube/audit
pkg/minikube/audit/row.go:128:4: t.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
pkg/minikube/audit/row.go:129:4: t.SetBorders undefined (type *tablewriter.Table has no field or method SetBorders)
pkg/minikube/audit/row.go:130:4: t.SetColumnSeparator undefined (type *tablewriter.Table has no field or method SetColumnSeparator)
# k8s.io/minikube/pkg/minikube/machine
pkg/minikube/machine/cache_images.go:849:8: table.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
pkg/minikube/machine/cache_images.go:850:8: table.SetBorders undefined (type *tablewriter.Table has no field or method SetBorders)
pkg/minikube/machine/cache_images.go:851:8: table.Alignment undefined (type *tablewriter.Table has no field or method Alignment)
pkg/minikube/machine/cache_images.go:852:8: table.SetColumnSeparator undefined (type *tablewriter.Table has no field or method SetColumnSeparator)

medyagh avatar Jul 13 '25 22:07 medyagh

@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 49bc23c 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

Victorthedev avatar Jul 16 '25 23:07 Victorthedev

@Victorthedev please check the build errors, it seems like the API has changed and needs to change the code

# k8s.io/minikube/pkg/minikube/audit
pkg/minikube/audit/row.go:128:4: t.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
pkg/minikube/audit/row.go:129:4: t.SetBorders undefined (type *tablewriter.Table has no field or method SetBorders)
pkg/minikube/audit/row.go:130:4: t.SetColumnSeparator undefined (type *tablewriter.Table has no field or method SetColumnSeparator)
# k8s.io/minikube/pkg/minikube/machine
pkg/minikube/machine/cache_images.go:849:8: table.SetAutoFormatHeaders undefined (type *tablewriter.Table has no field or method SetAutoFormatHeaders)
pkg/minikube/machine/cache_images.go:850:8: table.SetBorders undefined (type *tablewriter.Table has no field or method SetBorders)
pkg/minikube/machine/cache_images.go:851:8: table.Alignment undefined (type *tablewriter.Table has no field or method Alignment)
pkg/minikube/machine/cache_images.go:852:8: table.SetColumnSeparator undefined (type *tablewriter.Table has no field or method SetColumnSeparator)

Finally made headway

Victorthedev avatar Jul 16 '25 23:07 Victorthedev

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 49.7s    │ 50.0s                  │
│ enable ingress │ 14.7s    │ 14.9s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 49.2s 49.3s 49.5s 52.3s 48.0s Times for minikube (PR 20893) start: 48.9s 49.5s 51.9s 46.5s 53.2s

Times for minikube ingress: 14.4s 14.4s 14.9s 14.9s 14.9s Times for minikube (PR 20893) ingress: 14.9s 14.5s 15.9s 14.4s 14.9s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 24.6s    │ 22.8s                  │
│ enable ingress │ 12.6s    │ 13.2s                  │
└────────────────┴──────────┴────────────────────────┘

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

Times for minikube start: 22.5s 24.6s 25.1s 24.7s 25.9s Times for minikube (PR 20893) start: 22.4s 23.7s 22.7s 22.2s 23.1s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 22.8s    │ 22.6s                  │
│ enable ingress │ 26.0s    │ 29.1s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 22.9s 20.7s 23.0s 25.3s 22.1s Times for minikube (PR 20893) start: 24.4s 21.1s 20.4s 22.7s 24.2s

Times for minikube ingress: 22.8s 22.7s 38.7s 22.7s 22.8s Times for minikube (PR 20893) ingress: 22.7s 38.7s 22.7s 38.8s 22.7s

minikube-pr-bot avatar Jul 17 '25 00:07 minikube-pr-bot

awesome @Victorthedev good to see you progress please check this test log see if it is related

https://storage.googleapis.com/minikube-builds/logs/20893/40504/KVM_Linux.html#fail_TestFunctional%2fparallel%2fImageCommands%2fImageListTable

medyagh avatar Jul 17 '25 18:07 medyagh

awesome @Victorthedev good to see you progress please check this test log see if it is related

https://storage.googleapis.com/minikube-builds/logs/20893/40504/KVM_Linux.html#fail_TestFunctional%2fparallel%2fImageCommands%2fImageListTable

this is a test error most likely in functional_test.go, not related to what we've been working on. We can open a separate issue to fix it outside this PR, I can take a look at it.

Victorthedev avatar Jul 17 '25 22:07 Victorthedev

plz also make sure to pull upstream into your PR (we added go.work files that will need to be updated as part of this PR)

Yes i've pulled upstream master, this branch is currently up to date now

Victorthedev avatar Jul 17 '25 23:07 Victorthedev

kvm2 driver with docker runtime

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

Times for minikube (PR 20893) start: 55.1s 50.5s 50.1s 51.8s 52.5s Times for minikube start: 52.3s 53.8s 55.0s 51.4s 52.7s

Times for minikube (PR 20893) ingress: 14.5s 14.5s 15.1s 15.1s 15.6s Times for minikube ingress: 15.1s 15.0s 14.5s 15.1s 14.6s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 24.9s    │ 24.8s                  │
│ enable ingress │ 13.1s    │ 12.8s                  │
└────────────────┴──────────┴────────────────────────┘

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

Times for minikube start: 25.4s 23.8s 23.7s 25.1s 26.7s Times for minikube (PR 20893) start: 26.6s 22.7s 24.8s 24.5s 25.5s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20893 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.8s    │ 23.4s                  │
│ enable ingress │ 26.1s    │ 29.2s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 24.4s 21.3s 24.5s 25.7s 23.0s Times for minikube (PR 20893) start: 22.6s 23.4s 22.9s 22.2s 26.1s

Times for minikube ingress: 22.8s 22.9s 38.8s 22.8s 22.9s Times for minikube (PR 20893) ingress: 38.8s 22.8s 22.8s 22.8s 38.9s

minikube-pr-bot avatar Jul 18 '25 00:07 minikube-pr-bot

@Victorthedev I think the test failures are related to the PR "ImageListTable" only failing on this PR on all environments Docker Linux, KMV Linux and this PR is touching Tables so it must be that

medyagh avatar Jul 20 '25 03:07 medyagh

@Victorthedev pushed to your pr with some fixes need to fix the unit tests

medyagh avatar Jul 20 '25 04:07 medyagh