-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
3
-
None
-
NI&D Sprint 283, NI&D Sprint 284
Description
Implement the foundational set of read-only NIDS diagnostic tools using native Go libraries (client-go). These tools provide safe, non-mutating inspection of Ingress and DNS resources on a live cluster. This execution replaces the previous CLI-wrapper approach with a robust, product-ready Go implementation.
Goals
- Create, or adopt, a Go-based MCP server skeleton.
- Implement inspection tools for Route, Service, Endpoints, and CoreDNS.
- Ensure strict read-only execution.
Tool Definitions
1. get_coredns_config
- Description: Retrieve the CoreDNS ConfigMap to inspect the Corefile.
- Input Schema:
{ "type": "object", "properties": { "namespace": { "type": "string", "description": "Namespace (default: openshift-dns)" }, "configmap": { "type": "string", "description": "ConfigMap name (default: dns-default)" } }, "required": ["namespace"] }
- Output Schema:
{ "configmap": { /* standard ConfigMap object */ }, "corefile": "string (extracted corefile content)" }
Implementation Steps
- If not adopting an existing MCP server project, initialize Go Project:
- Set up a new Go module/package for the NIDS tools.
- Import net/http (for MCP), k8s.io/client-go, and controller-runtime (optional, for client convenience).
- Implement get_coredns_config:
- Logic: Fetch the ConfigMap and return the Corefile.
- Constraint Checklist:
- No usage of exec.Command("oc", ...) or exec.Command("dig", ...).
- Must use structured error handling.
Acceptance Criteria
- MCP tool get_coredns_config matches schema.
- All implementation is native Go (no shell-outs).