Skip to content

Update image validation for MCPRegistry phase rename #4510

Closed

Description

@ChrisJBurns

Description

Update image_validation.go and its test suite to use the new MCPRegistryPhaseRunning phase (renamed from MCPRegistryPhaseReady in #4269).

Depends on: #4269

Context

The image validation logic at cmd/thv-operator/pkg/validation/image_validation.go:201 checks whether an MCPRegistry is in the Ready phase before using it for image validation:

if mcpRegistry.Status.Phase != mcpv1alpha1.MCPRegistryPhaseReady {
    return false, nil
}

After #4269 lands, MCPRegistryPhaseReady no longer exists — it becomes MCPRegistryPhaseRunning to match the MCPServer pattern. This is production code that gates whether MCPServers with enforceServers: true can validate images against registries.

Implementation Notes

Files:

  • cmd/thv-operator/pkg/validation/image_validation.go — update phase check from MCPRegistryPhaseReady to MCPRegistryPhaseRunning
  • cmd/thv-operator/pkg/validation/image_validation_test.go — update all test cases that reference MCPRegistryPhaseReady (25+ cases)

The change is mechanical (find-and-replace the phase constant) but the test suite is large and should be verified carefully since this is a security-relevant code path (image validation enforcement).

Testing

  • All existing image_validation_test.go tests pass with the renamed phase constant
  • task test passes

Acceptance Criteria

  • MCPRegistryPhaseReady replaced with MCPRegistryPhaseRunning in image_validation.go
  • All test cases in image_validation_test.go updated
  • No references to MCPRegistryPhaseReady remain in pkg/validation/
  • task test passes

Activity

  1. added a commit that references this issue on Apr 7, 2026
    7929c07
  2. added a commit that references this issue on Apr 8, 2026
    d68ea47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

breaking-changekubernetesoperator

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions