MCPRemoteProxy podTemplateSpec ports without protocol cause repeated Deployment updates

Abierto
#7,064 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, kubernetes
Área
backend, devops

Línea de trabajo

Start in cmd/thv-operator/controllers/mcpremoteproxy_controller.go at remoteProxyContainerFieldsNeedUpdate and compare its port check with ContainerPortsDiffer in cmd/thv-operator/pkg/controllerutil/authserver.go. The issue also flags env, probe, and security context comparisons as possible defaulting gaps. Check or add focused tests for repeated reconciliation with an omitted port protocol; done means the Deployment no longer updates repeatedly for that case.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-triage

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.

Lenguaje dominante
Go
Estrellas
2.3k
Forks
326
Merge medio
1 d 53 min
PR fusionados (30 d)
155

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stacklok/toolhive

Todos los issues de stacklok/toolhive

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.