fix(operator): recreate deleted MCPServer StatefulSet - #6379
Merged
reyortiz3 merged 5 commits intoAug 21, 2026
Merged
Conversation
The runner-created workload StatefulSet had no owner watch, so deleting it left Ready true on a proxy-only stack. Adopt the STS, recreate it by bouncing the proxy when it is missing, and keep status Pending until it returns. Fixes stacklok#6343
RaviTharuma
requested review from
ChrisJBurns,
JAORMX,
blkt,
jerm-dro,
jhrozek,
rdimitrov,
reyortiz3 and
tgrunnagle
as code owners
August 19, 2026 07:00
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
|
Implements #6343 per maintainer direction. Cross-links: |
Collaborator
|
@RaviTharuma mind fixing the lint error? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6379 +/- ##
==========================================
+ Coverage 72.98% 77.67% +4.69%
==========================================
Files 744 751 +7
Lines 78611 72694 -5917
==========================================
- Hits 57374 56467 -907
+ Misses 17236 16222 -1014
+ Partials 4001 5 -3996 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
reyortiz3
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cross-links
Summary
Deleting the runner-created MCPServer StatefulSet left the proxy Deployment
up and
Ready=true. Clients hit a dead backend. The operator created theDeployment but did not watch/adopt the STS, so orphan-cleanup scripts treated
it as leftover.
MCPServer
(existing
restarted-atannotation, 2m cooldown) so the runner re-appliesboot)
Fixes #6343
Type of change
Test plan
go test -ldflags=-extldflags=-Wl,-w ./cmd/thv-operator/controllers/ -run 'TestEnsureWorkloadStatefulSet|TestMapStatefulSetToMCPServer|TestRecentlyBounced'the STS, and keep MCPServer Pending until it is back
API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.No CRD schema change. RBAC already includes StatefulSets.
Does this introduce a user-facing change?
Yes. A deleted MCPServer workload StatefulSet is recreated on the next
reconcile, and Ready is no longer claimed on a proxy-only stack. See
docs/operator/mcpserver-workloads.md.Special notes for reviewers
The operator still does not author the STS spec — the proxy-runner does via
SSA. Recreate is "bounce the runner so it applies again," which matches how
the STS is born. Cooldown avoids a restart loop while the runner is still
starting.