mcp: migrate healthcheck tool to call pkg/functions directly#3788
mcp: migrate healthcheck tool to call pkg/functions directly#3788vishal-iiserb wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vishal-iiserb The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
Welcome @vishal-iiserb! It looks like this is your first PR to knative/func 🎉 |
|
Hi @vishal-iiserb. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Part of the phased migration in #3771.
Next candidate: describe.
What changed###
tools_healthcheck.go: handler now callss.client.List(ctx, "")viapkg/functions directly to verify cluster connectivity, replacing the
server-only liveness check.
mcp.go: addedclient *fn.Clientfield to Server, initialized inNew(), and addedWithClientoption for test injection.tools_healthcheck_test.go: new tests for cluster-reachable,cluster-unreachable, and output schema shape — no subprocess involved.
Why###
The previous healthcheck only confirmed the MCP process was alive. Agents
had no way to know if the underlying cluster was reachable before calling
other tools. This change surfaces that information as a typed field.
Tests###
go test ./pkg/mcp/... -v— all pass including 4 new healthcheck tests.Fixes: part of #3771