Skip to content

Conversation

@XiaWuSharve
Copy link

@XiaWuSharve XiaWuSharve commented Jan 8, 2026

Fix formatting issue in minikube service tunnel output

fixes #22133

Problem Description

When running minikube service <service-name>, as reported in issue #22133, before this fix, the output Starting tunnel for service <service-name>. was incorrectly followed by a / character without a line break. The table would start printing immediately on the same line. Furthermore, an extra duplicate line Starting tunnel for service <service-name>. would appear after the table. The root cause was a race condition: the spinner attached to the status message via style.Running used in pkg/minikube/tunnel/kic/ssh_conn.go attempted to refresh in place, but the concurrent output of the table moved the cursor, preventing the spinner from overwriting itself. This resulted in the spinner's final state being appended to the end of the output stream.

before

Solution in This PR

This PR removes the unintended / character and ensures proper line breaks. The fix works by changing the output style to one without a spinner (style.StartingSSH). This guarantees that the status message is printed completely (ending with a newline \n) before the table is rendered, eliminating the cursor conflict and the duplicate line. This directly resolves the readability issue described in #22133.

after

Verification

  • Built and tested locally using: out/minikube service hello-node
  • The output now correctly shows
  • make test passed.

Notes on Future UI Considerations

While this PR is aiming at closing #22133 by fixing the immediate formatting bug, it highlights a potential deeper UI concern: printing the final table while tunnels are still starting (a process that can sometimes take over a second) might be suboptimal. A more robust approach could involve either:

  1. Printing the table only after all tunnels have been confirmed established, or
  2. Printing the table first and then dynamically updating it with the connection status of each tunnel.
    These enhancements are noted here for future consideration but are outside the scope of this specific formatting fix.

Note to Reviewers

Hi, this is my first PR to the minikube project. I've tried to follow the contribution guidelines, but I'm sure there might be areas I've overlooked or conventions I'm not yet familiar with. I'd be very grateful for any feedback on the fix itself, the code style, or the PR process. Please don't hesitate to point out anything that could be improved. Thank you!

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jan 8, 2026
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 8, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: XiaWuSharve / name: 夏午Sharve (db8ea87)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: XiaWuSharve
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.

Details 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
Copy link
Contributor

Welcome @XiaWuSharve!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2026
@k8s-ci-robot
Copy link
Contributor

Hi @XiaWuSharve. 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.

Details

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 cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 8, 2026
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 8, 2026
@XiaWuSharve XiaWuSharve force-pushed the fix-service-tunnel-output-format branch from 29fb287 to dd31dcd Compare January 8, 2026 15:10
- Replace `style.Running` with `style.StartingSSH` in `startAndWait` function.
- This prevents the spinner animation from clashing with the subsequent table output, fixing the missing newline issue.
@XiaWuSharve XiaWuSharve force-pushed the fix-service-tunnel-output-format branch from dd31dcd to db8ea87 Compare January 8, 2026 15:20
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jan 8, 2026
@medyagh
Copy link
Member

medyagh commented Jan 8, 2026

@XiaWuSharve can you please put Before This PR as well as after to see the difference?

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.

@XiaWuSharve please put before/After this PR to compare

@medyagh medyagh changed the title fix: correct formatting in tunnel service output ui: fix correct formatting in tunnel service output Jan 8, 2026
@XiaWuSharve
Copy link
Author

Hi @medyagh ,

Thank you for the feedback. I have updated the PR description as suggested, adding a clear “Before” and “After” output comparison to showcase the fix for the formatting issue.

Please take a look when you have a moment.

@XiaWuSharve XiaWuSharve requested a review from medyagh January 9, 2026 05:37
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI Formatting: Missing newline and stray characters in "minikube service" output

4 participants