stacklok / stacklok/toolhive

Add EventRecorder and Scheme to MCPGroup controller

Open
#4,632 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Summary

The MCPGroupReconciler struct has only a client.Client field — no Recorder, no Scheme. No Kubernetes events are recorded for MCPGroup state transitions. Every other controller (MCPServer, MCPRemoteProxy, EmbeddingServer, VirtualMCPServer) receives an EventRecorder.

Severity: MUST FIX
Area: Controller Logic
Breaking: No

Location

  • cmd/thv-operator/controllers/mcpgroup_controller.go:30-32
  • cmd/thv-operator/main.go:315-317

Problem

The MCPGroup controller has no way to emit Kubernetes events for its operations, unlike every other controller in the codebase.

Impact

  • No Kubernetes events for MCPGroup operations (creation, deletion blocking, member changes)
  • Reduced observability and debugging capability compared to other controllers

Recommended Fix

  1. Add Recorder record.EventRecorder and Scheme *runtime.Scheme to MCPGroupReconciler struct
  2. Pass mgr.GetEventRecorderFor("mcpgroup-controller") and mgr.GetScheme() in main.go
  3. Record events for key state transitions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cmd/thv-operator/controllers/mcpgroup_controller.go:30-32 and compare the MCPServer, MCPRemoteProxy, EmbeddingServer, and VirtualMCPServer controllers. Then inspect cmd/thv-operator/main.go:315-317 to follow how controller dependencies are passed. Done means MCPGroupReconciler receives the recorder and scheme and records events for creation, deletion blocking, and member changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, devops, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.