Drop blockOwnerDeletion on proxy-runner owned Services
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go, kubernetes
- Área
- authorization, infrastructure
Línea de trabajo
Start in pkg/container/kubernetes/client.go, at ensureBackendServices and the service apply helper, where BlockOwnerDeletion is set, then check the two assertions in client_test.go. The RBAC change touches defaultRBACRules and its kubebuilder marker, followed by regenerating role.yaml. The issue asks a maintainer to decide whether to drop the flag or keep the finalizers grant, so confirm that choice in the thread before editing. Done means the tests pass and role.yaml matches the chosen approach.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Proposal
Stop setting blockOwnerDeletion: true on the owner reference the proxy runner puts on the headless and ClusterIP Services pointing at their StatefulSet. Once that's done, drop the apps/statefulsets/finalizers grant that #6756 adds.
Background
On OpenShift, OwnerReferencesPermissionEnforcement rejects a blockOwnerDeletion: true owner reference unless the caller has update on the owner's /finalizers (#6835). #6756 fixes that by granting statefulsets/finalizers to the proxy-runner Role and to the operator ClusterRole. The operator needs it too because Kubernetes won't let it grant a permission it doesn't hold.
That's the standard fix, but it's RBAC we may not need. The flag only does something when the owner is deleted with foreground propagation: the StatefulSet would wait until its Services are gone. We never delete that way:
RemoveWorkloaddeletes the StatefulSet with emptyDeleteOptions(background) inpkg/container/kubernetes/client.go.finalizeMCPServerdeletes the StatefulSet and both Services by name.- Nothing in production code sets
PropagationPolicyorDeletePropagationForeground.
GC still removes the Services once the StatefulSet is gone, with or without the flag.
Change
pkg/container/kubernetes/client.go,ensureBackendServices: dropBlockOwnerDeletion: ptr.To(true)from the StatefulSet owner reference.pkg/container/kubernetes/client.go, the service apply helper: drop the hardcodedWithBlockOwnerDeletion(true). It ignores whatever the owner passed in says anyway.pkg/container/kubernetes/client_test.go: update the two assertions that expecttrue.- Revert the
apps/statefulsets/finalizersentry indefaultRBACRulesand its+kubebuilder:rbacmarker, then regeneraterole.yaml.
Why it's safe
- Admission rules: the plugin only asks for the finalizers permission when an owner reference is newly blocking or flipped to blocking (source). Removing the flag, or leaving it out, never triggers that check. Any change to owner refs also needs
deleteon the object itself, and the proxy-runner Role already hasdeleteon services. - Existing Services on vanilla clusters: the next Force apply drops the field. That passes even with the plugin on.
- OpenShift: nothing to migrate, because Service creation has failed there since #3992.
- Recreated StatefulSet (new UID): under B this needs no extra permission. Under the current grant approach it needs the finalizers permission every time.
- Coverage: this is the only owner reference the proxy runner sets. The runner creates the StatefulSet with no owner, and the operator later adopts it under the MCPServer.
What B buys over the RBAC grant alone
- Least privilege: with the grant, every MCPServer's runner service account can set blocking owner references on any StatefulSet in its namespace.
- Mixed versions: a newer runner works against an older operator chart that lacks
statefulsets/finalizers.
Related
- Enable
OwnerReferencesPermissionEnforcementintest/e2e/thv-operator/kind-config.yaml(apiServer.extraArgs). The chainsaw job inoperator-ci.ymlcreates its kind cluster without a config and would need one too. This would have caught #3992, and it would prove B in CI. Ideally it lands with or before B.
Open question
@ChrisJBurns, what do you think? Is it worth dropping the flag and shrinking the RBAC footprint, or should we stick with the conventional /finalizers grant from #6756?
Refs #6756, #6835
- Lenguaje dominante
- Go
- Estrellas
- 2.3k
- Forks
- 318
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 104
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stacklok/toolhive
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
stacklok/toolhive#6925 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
proxyrunner tool-filter middleware strips SEP-2322 Modern envelope from tools/list, breaking vMCP health checksPosiblemente ocupada @alex-feel la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
stacklok/toolhive#6684 · 5 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
HttpClientBuilder.Build() ignores HTTP(S)_PROXY (auth-server OAuth/DCR calls bypass forward proxy)Posiblemente ocupada @schonmann la tomó hace 19 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
stacklok/toolhive#6671 · 2 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`thv run` ignores `--oidc-insecure-allow-http` and `--thv-ca-bundle` — both dropped in `createOIDCConfig` (same as #1470)Posiblemente ocupada @7487 la tomó hace 46 días. Abiertoauthentication bug cli oidc p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
stacklok/toolhive#6522 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Delete the dead pkg/vmcp/server/adapter packageQuizá libre de nuevo @suantea la tomó hace 12 días y no hay ningún pull request abierto. Abiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
Todos los issues de stacklok/toolhive
Issues similares
-
status:needs-review type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Gentleman-Programming/engram#2079 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
limitlessprojects/Go-Hybrid#1377 ·
Los mantenedores suelen responder en 1 día
-
bug report
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día