MCPRemoteProxy podTemplateSpec ports without protocol cause repeated Deployment updates

Aperta
#7,064 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
backend, devops

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
2.3k
Fork
326
Merge medio
1g 53m
PR unite (30g)
155

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stacklok/toolhive

Tutte le issue di stacklok/toolhive

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.