Skip to content

Remove enforceServers field and image validation from MCPRegistry #4717

Closed

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

Activity

  1. added
    bug
    on Apr 9, 2026
  2. added
    go
    kubernetes
    on Apr 9, 2026
  3. added 2 commits that reference this issue on Apr 9, 2026
    b4a15bb
    3184762
  4. changed the title [-]Fix image_validation.go GetStorageName() for configYAML path[/-] [+]Remove enforceServers field and image validation from MCPRegistry[/+] on Apr 13, 2026
  5. added a commit that references this issue on Apr 13, 2026
    a4b74ce
  6. added a commit that references this issue on Apr 13, 2026
    64378ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changebuggokubernetesoperator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions