Skip to content

fix(ctl/dump): stop execution when port-forward fails to start - #1927

Open
pratham15541 wants to merge 3 commits into
kmesh-net:mainfrom
pratham15541:fix/dump-portforward-exit-on-failure
Open

pratham15541 wants to merge 3 commits into
kmesh-net:mainfrom
pratham15541:fix/dump-portforward-exit-on-failure

Conversation

@pratham15541

Copy link
Copy Markdown

Fixes: #1926
RunDump logged a port-forward start failure but kept running, going on to call http.Get() against a local address with nothing forwarded to it. This produced a confusing secondary connection refused error that masked the real failure reason.

RunDump logged a port-forward start failure but kept running, going on
to call http.Get() against a local address with nothing forwarded to
it. This produced a confusing secondary 'connection refused' error
that masked the real failure reason.

Aligns ctl/dump/dump.go with the identical pattern already used in
ctl/log/log.go, ctl/monitoring/monitoring.go, and ctl/authz/authz.go.
Copilot AI lite review requested due to automatic review settings August 15, 2026 15:52
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign supercharge-xsy for approval. For more information see the Kubernetes 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

@kmesh-bot

Copy link
Copy Markdown
Collaborator

Welcome @pratham15541! It looks like this is your first PR to kmesh-net/kmesh 🎉

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes kmeshctl dump error handling so that if the Kubernetes port-forward fails to start, the command stops immediately instead of continuing and producing a misleading secondary connection refused error.

Changes:

  • Exit immediately when fw.Start() fails in RunDump, preventing follow-on HTTP calls to an unforwarded local address.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ctl/dump/dump.go
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 15, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.58%. Comparing base (c6357aa) to head (15980c4).
⚠️ Report is 14 commits behind head on main.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec501a9...15980c4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings August 23, 2026 08:44
@kmesh-bot

Copy link
Copy Markdown
Collaborator

Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository.
Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found 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/test-infra repository.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kmeshctl dump continues after port-forward start fails, masking the real error

3 participants