Skip to content

MCPRemoteProxy podTemplateSpec ports without protocol cause repeated Deployment updates #7064

Open

Description

@jhrozek

When an MCPRemoteProxy has a spec.podTemplateSpec that adds a port to the proxy container without setting protocol, the operator likely sees a difference on every reconcile and keeps updating the Deployment.

remoteProxyContainerFieldsNeedUpdate in cmd/thv-operator/controllers/mcpremoteproxy_controller.go compares the live container with the expected one built by deploymentForMCPRemoteProxy:

!equality.Semantic.DeepEqual(current.Ports, expected.Ports) ||

The expected container comes from applying the raw podTemplateSpec patch, so a port written as

ports:
  - name: metrics
    containerPort: 9090

has Protocol: "" on the expected side. The API server fills in TCP on the stored Deployment, so DeepEqual never matches.

I found this by reading the code while reviewing the operator port changes for the auth server TLS listener. I haven't reproduced it on a cluster. VirtualMCPServer had the same issue in that work and now treats an empty protocol as TCP when comparing ports (ContainerPortsDiffer in cmd/thv-operator/pkg/controllerutil/authserver.go). The same approach, or comparing ports with that helper, should work here. The other DeepEqual checks in that function (env, probes, security context) may have similar API-server defaulting gaps and are worth a look at the same time.

Activity

  1. added
    needs-triage
    on Nov 6, 2026
  2. removed
    needs-triage
    on Nov 24, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions