Skip to content

refactor(ctl): add structured fetch helpers as MCP groundwork - #1901

Draft
neiljar wants to merge 1 commit into
kmesh-net:mainfrom
neiljar:mcp-gw/ctl
Draft

refactor(ctl): add structured fetch helpers as MCP groundwork#1901
neiljar wants to merge 1 commit into
kmesh-net:mainfrom
neiljar:mcp-gw/ctl

Conversation

@neiljar

@neiljar neiljar commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

Groundwork for the Kmesh MCP server (#1800). Today many kmeshctl commands print tables and call os.Exit on failure. An MCP process reusing that code would get unstructured text or crash.

This PR extracts typed fetch helpers that return data + error, wires CLI through RunE, and adds unit tests for HTTP helpers. It does not add the mcp/ server.

Changes:

  • version / log / dump / authzFetch* / Get* helpers; RunE; no library os.Exit; Writer-based CLI output
  • waypointListWaypoints, GetWaypointStatuses (no wait); list command uses them
  • health (new) — FetchDaemonHealth / GetDaemonHealth for /debug/ready
  • utilsListDaemonPods, ListMeshNamespaces
  • monitoring / secret — same error/RunE cleanup
  • tests — httptest coverage for version, log, dump, authz, health fetch paths

Which issue(s) this PR fixes:
Related to #1800

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Neil <neiljar888@gmail.com>
@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 lizhencheng9527 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

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.

2 participants