Remove dead webhook manifests that would break clusters if applied
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
Summary
Two ValidatingWebhookConfiguration manifests define webhooks for 3 resources with failurePolicy: Fail, but zero webhook handlers exist in the codebase. If these manifests were accidentally applied to a cluster, ALL CREATE/UPDATE requests for the affected resources would fail because the webhook endpoints return connection errors.
Severity: MUST FIX
Area: Webhooks
Breaking: No
Location
cmd/thv-operator/config/webhook/manifests.yamlconfig/webhook/manifests.yaml
Problem
The manifests define webhooks for MCPExternalAuthConfig, VirtualMCPCompositeToolDefinition, and VirtualMCPServer, but:
- Zero
+kubebuilder:webhookmarkers in any Go file - Zero
SetupWebhookWithManager()functions - Zero
ValidateCreate/ValidateUpdate/ValidateDeleteimplementations - Zero webhook registrations in main.go
- The Helm chart has no webhook templates
Impact
- Cluster-breaking risk if manifests are accidentally applied
- Confusing codebase — manifests suggest webhooks exist when they don't
- The
main.gostarts a webhook server on port 9443 that serves nothing (see #4627)
Recommended Fix
Option A (clean up dead code — recommended):
- Delete both
manifests.yamlfiles - Remove
WebhookServerfrom main.go (#4627) - Document the validation model (CEL + reconciler) as an explicit design decision
Option B (implement webhooks):
- Add
+kubebuilder:webhookmarkers and handler code - Add Helm templates for webhook Service, cert-manager Certificate, ValidatingWebhookConfiguration
- Wire up in main.go
Related Issues
- Remove unused webhook server listening on port 9443 (#4627)
- Extract mutation from Validate method into separate defaulting logic (#4628)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting cmd/thv-operator/config/webhook/manifests.yaml and config/webhook/manifests.yaml, then check main.go and the related #4627 issue to separate this cleanup from the webhook-server change. Verify that no webhook handlers or registrations exist, and consider how the validation model should be documented. Done means the dead manifests no longer remain without leaving references that imply active webhooks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100