Skip to content

fix(tunnel): handle existing route on Windows gracefully#22729

Open
VedantMadane wants to merge 1 commit intokubernetes:masterfrom
VedantMadane:fix/windows-tunnel-route-exists
Open

fix(tunnel): handle existing route on Windows gracefully#22729
VedantMadane wants to merge 1 commit intokubernetes:masterfrom
VedantMadane:fix/windows-tunnel-route-exists

Conversation

@VedantMadane
Copy link
Copy Markdown

Fixes #11645

On Windows, the route ADD command returns exit code 0 even when the route already exists. This causes minikube tunnel to infinitely retry adding the same route.

Fix by checking the output message for 'already exists' indication and treating it as success (making EnsureRouteIsAdded truly idempotent).

The issue manifests when running \minikube tunnel --cleanup\ on Windows - it gets stuck in a retry loop instead of completing successfully.

Testing

  • Compiles with no errors
  • Logic handles duplicate route additions gracefully
  • Maintains backward compatibility with non-Windows platforms

@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 Mar 2, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Mar 2, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: VedantMadane / name: Vedant Madane (995898b)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: VedantMadane
Once this PR has been reviewed and has the lgtm label, please assign comradeprogrammer 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 k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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

@minikube-bot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@VedantMadane VedantMadane force-pushed the fix/windows-tunnel-route-exists branch from 33283e5 to b3821ac Compare March 25, 2026 20:37
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2026
The tunnel route command on Windows can fail when a route already
exists. Instead of parsing stderr output, check the command exit
code directly for more reliable success detection. Also handle
the 'route already exists' case gracefully by treating it as a
non-fatal condition.
@VedantMadane VedantMadane force-pushed the fix/windows-tunnel-route-exists branch from b3821ac to 995898b Compare April 16, 2026 05:50
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 16, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minikube tunnel is not working on Windows (endessly trying to add a route)

3 participants