Skip to content

Remove enforceServers field and image validation from MCPRegistry #4717

@ChrisJBurns

Description

@ChrisJBurns

Summary

The enforceServers field on MCPRegistrySpec and its associated image validation code should be removed. The feature has been broken and non-functional since PR #2568 removed the data sources from the operator.

Why it's broken

The image validation code in checkImageInRegistry reads from a {name}-registry-storage ConfigMap to check whether an MCPServer's image exists in a registry. This ConfigMap was originally created by the operator's StorageManager (in cmd/thv-operator/pkg/sources/storage_manager.go), which synced registry data from sources (Git, API, ConfigMap) and persisted it.

PR #2568 moved all data source handling from the operator into the registry server itself and deleted the StorageManager. Nothing creates the {name}-registry-storage ConfigMap anymore. As a result, the ConfigMap lookup always returns NotFound, and enforceServers: true silently does nothing — every image check returns "not found" but the validator treats this as "registry data not available" and allows the image through.

Why we can't just fix it

The registry server now manages its own data lifecycle — it fetches from configured sources (Git repos, API endpoints, Kubernetes, files) and stores the results in its own database. The operator treats the registry configuration as opaque (configYAML). This means:

  1. The operator doesn't have the resolved data — it only has source definitions, not the actual server/image list
  2. Querying the registry API would add HTTP dependencies to the validation path, which is undesirable in a controller's reconciliation loop
  3. The registry server doesn't write resolved data to a ConfigMap — it uses its own internal storage

Resolution

Remove the feature entirely:

  • Remove EnforceServers field from MCPRegistrySpec
  • Delete image_validation.go and its tests
  • Remove image validation wiring from MCPServer and EmbeddingServer controllers
  • Remove ConditionImageValidated and related status condition constants
  • Remove GetStorageName() and getConfigMapName() dead code
  • Clean up documentation references
  • Regenerate CRD manifests

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changebugSomething isn't workinggoPull requests that update go codekubernetesItems related to Kubernetesoperator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions