Skip to content

CORENET-7134: Add ovn-kubernetes toolset skeleton#315

Draft
mattedallo wants to merge 4 commits into
openshift:mainfrom
mattedallo:corenet-7134-ovnk-toolset
Draft

CORENET-7134: Add ovn-kubernetes toolset skeleton#315
mattedallo wants to merge 4 commits into
openshift:mainfrom
mattedallo:corenet-7134-ovnk-toolset

Conversation

@mattedallo

@mattedallo mattedallo commented May 19, 2026

Copy link
Copy Markdown

Summary

Registers a new ovn-kubernetes toolset as scaffolding for OVN-Kubernetes networking diagnostics integration (enhancements#2002).

  • Adds pkg/toolsets/ovnkubernetes/toolset.go — empty toolset implementing api.Toolset, registered via init()
  • Adds blank import in pkg/mcp/modules.go
  • Adds ovn-kubernetes to the TestGranularToolsetsTools snapshot test with an empty [] snapshot

The toolset ships with zero tools — sibling stories CORENET-7135 (OVS tools) and CORENET-7136 (OVN tools) will add tool handlers on top of this framework.

Verification

  • make build — binary compiles with the new toolset
  • make test — all tests pass (including the new snapshot test)
  • make lint — no lint violations

What is NOT in this PR

  • No tool implementations (deferred to CORENET-7135/7136/7137/7138)
  • No ovn-kubernetes-mcp Go dependency (arrives with tool implementations)
  • No execution adapter / pod-exec changes (depends on CORENET-7133)
  • No README/docs update (zero tools means empty generated sections)

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced OVN-Kubernetes CNI network troubleshooting toolset, providing dedicated network diagnostic and troubleshooting capabilities for OVN-Kubernetes environments.
  • Tests

    • Extended test coverage to include validation of the new OVN-Kubernetes toolset and its associated network troubleshooting tools.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 19, 2026
@openshift-ci-robot

openshift-ci-robot commented May 19, 2026

Copy link
Copy Markdown

@mattedallo: This pull request references CORENET-7134 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Registers a new ovn-kubernetes toolset as scaffolding for OVN-Kubernetes networking diagnostics integration (enhancements#2002).

  • Adds pkg/toolsets/ovnkubernetes/toolset.go — empty toolset implementing api.Toolset, registered via init()
  • Adds blank import in pkg/mcp/modules.go
  • Adds ovn-kubernetes to the TestGranularToolsetsTools snapshot test with an empty [] snapshot

The toolset ships with zero tools — sibling stories CORENET-7135 (OVS tools) and CORENET-7136 (OVN tools) will add tool handlers on top of this framework.

Verification

  • make build — binary compiles with the new toolset
  • make test — all tests pass (including the new snapshot test)
  • make lint — no lint violations

What is NOT in this PR

  • No tool implementations (deferred to CORENET-7135/7136/7137/7138)
  • No ovn-kubernetes-mcp Go dependency (arrives with tool implementations)
  • No execution adapter / pod-exec changes (depends on CORENET-7133)
  • No README/docs update (zero tools means empty generated sections)

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d2b18601-6d8b-4de8-a66e-4e22f42b7ea7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a new OVN-Kubernetes toolset to the OpenShift MCP server. It defines a toolset struct with network troubleshooting capabilities, registers it in the module system, and integrates it into the existing toolset test suite with snapshot validation.

Changes

OVN-Kubernetes Toolset

Layer / File(s) Summary
OVN-Kubernetes Toolset Implementation
pkg/toolsets/ovnkubernetes/toolset.go
Defines Toolset struct implementing api.Toolset with GetName() returning "ovn-kubernetes", GetDescription() returning "OVN-Kubernetes CNI network troubleshooting tools", and GetTools, GetPrompts, GetResources, GetResourceTemplates all returning nil. Registers via init().
Module Registration and Test Integration
pkg/mcp/modules.go, pkg/mcp/toolsets_test.go, pkg/mcp/testdata/toolsets-ovn-kubernetes-tools.json
Side-effect import in modules.go enables toolset initialization. Test import and TestGranularToolsetsTools case addition expand snapshot coverage. Test data file provides empty JSON array snapshot.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A toolset for networks, with OVN's own flair,
Rabbits hop swiftly through troubleshooting care,
Snapshots and tests in a bundle so neat,
One more small hop makes the feature complete! 🐰🔧

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a new ovn-kubernetes toolset skeleton with appropriate reference to the tracking ticket.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 19, 2026
@openshift-ci

openshift-ci Bot commented May 19, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented May 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mattedallo
Once this PR has been reviewed and has the lgtm label, please assign cali0707 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

@mattedallo

Copy link
Copy Markdown
Author

/test all

@mattedallo

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mattedallo mattedallo marked this pull request as ready for review May 20, 2026 09:29
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 20, 2026
@openshift-ci openshift-ci Bot requested review from Cali0707 and Kaustubh-pande May 20, 2026 09:32
@openshift-ci

openshift-ci Bot commented May 20, 2026

Copy link
Copy Markdown

@mattedallo: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@@ -0,0 +1,38 @@
package ovnkubernetes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems pretty empty

why not land this with actual tools (e.g. as go module)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi @matzew, thanks for reviewing!

Yep, we have a followup PRs coming for the tools.
But If you prefer I may add some of them into this PR directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes - I'd think we do not land empty toolsets here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 let's at least try to land the first tool in this PR. If you want to then incrementally add some more tools in future PRs that is cool

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @matzew and @Cali0707 for the feedback.
I will update the PR to include the first tools

@mattedallo mattedallo Jun 9, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi @matzew and @Cali0707, While adding the tools I am considering this approach:

the upstream exports tool definitions using gosdk.Tool from the go-sdk (a type both repos already depend on), paired with a type-erased execution function. In here we just iterates and converts (From gosdk.Tool to api.Tool) , no manual schema duplication. When upstream adds a new tool, downstream would have the tool automatically with version bump.

The benefit is that we don't duplicate the schema definition and we get the new tools automatically with version bump.
Is this something desired or you see problems with this approach?

@matzew

matzew commented May 27, 2026

Copy link
Copy Markdown
Member

@mattedallo also, if this new toolset is directly mapping to "upstream" ovn-k8s, I think the right address for PRs like that might be the actual upstream repo. Here, on OCP downstream, we might want to have mostly OCP specifics.

That said, see recent discussion on #122 that for some CRUD tools, it might be also just fine to provide evals and see if those are passing already w/ our core toolset

Register an empty ovn-kubernetes toolset so sibling stories (CORENET-7135/7136)
can land OVN/OVS tool handlers on top of this framework.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matteo Dallaglio <mdallagl@redhat.com>
@mattedallo mattedallo marked this pull request as draft June 5, 2026 11:29
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2026
Import the ovn-kubernetes-mcp library which provides OVN network
analysis tools (show, get, lflow-list, trace) as an MCP server.
Signed-off-by: Matteo Dallaglio <mdallagl@redhat.com>
Prototype of upstream changes that export tool definitions via
AllToolRegistrations() using *mcp.Tool as the shared interface:

- Add ExecTarget type for role-based container routing
- Add MakeExecute generic helper for type-erased method dispatch
- Add TargetSelector per tool (dbTarget, staticTarget)
- Export named tool vars (ShowTool, GetTool, LFlowListTool, TraceTool)
- Refactor AddTools() to use exported tool vars

This is a proof-of-concept — the actual change would be an upstream PR
to github.com/ovn-kubernetes/ovn-kubernetes-mcp.
Signed-off-by: Matteo Dallaglio <mdallagl@redhat.com>
@arkadeepsen

Copy link
Copy Markdown
Member

@mattedallo also, if this new toolset is directly mapping to "upstream" ovn-k8s, I think the right address for PRs like that might be the actual upstream repo. Here, on OCP downstream, we might want to have mostly OCP specifics.

That said, see recent discussion on #122 that for some CRUD tools, it might be also just fine to provide evals and see if those are passing already w/ our core toolset

Hey @matzew, one of the reasons not to add these tools to upstream is because some of the ovnk tools need the node-debug functionality and as per some existing conversations it seems that adding that tool upstream is not in current plans. Additionally, upstream k8s-mcp-server might want to be CNI agnostic whereas for openshift-mcp-server these tools will be very useful as most customers use ovnk as the CNI. We already have a separate upstream repo for ovnk mcp server (https://github.com/ovn-kubernetes/ovn-kubernetes-mcp) and thus adding these tools in k8s-mcp-server will mean that 2 separate upstream projects have the same tools, which probably is not ideal.

I have created an EP (openshift/enhancements#2002) where we can have further discussions on this topic. PTAL.
cc @tssurya

Consume ovn-kubernetes-mcp's AllToolRegistrations() in a generic loop
that converts *mcp.Tool to api.Tool and wires handlers automatically.
No per-tool knowledge in the downstream — new tools added upstream
propagate on go mod vendor with zero code changes here.
Signed-off-by: Matteo Dallaglio <mdallagl@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants