You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCPRemoteProxy podTemplateSpec ports without protocol cause repeated Deployment updates #7064
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:
The expected container comes from applying the raw podTemplateSpec patch, so a port written as
ports:
- name: metricscontainerPort: 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