Drop blockOwnerDeletion on proxy-runner owned Services
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 28/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- authorization, infrastructure
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 2.3k
- Fork
- 318
- Merge medio
- 2g 3h
- PR unite (30g)
- 104
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stacklok/toolhive
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
stacklok/toolhive#6925 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
proxyrunner tool-filter middleware strips SEP-2322 Modern envelope from tools/list, breaking vMCP health checksForse già presa @alex-feel l’ha presa 28 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
stacklok/toolhive#6684 · 5 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
HttpClientBuilder.Build() ignores HTTP(S)_PROXY (auth-server OAuth/DCR calls bypass forward proxy)Forse già presa @schonmann l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stacklok/toolhive#6671 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`thv run` ignores `--oidc-insecure-allow-http` and `--thv-ca-bundle` — both dropped in `createOIDCConfig` (same as #1470)Forse già presa @7487 l’ha presa 45 giorni fa. Apertaauthentication bug cli oidc p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
stacklok/toolhive#6522 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Delete the dead pkg/vmcp/server/adapter packageForse di nuovo libera @suantea l’ha presa 12 giorni fa e non c’è nessuna pull request aperta. Apertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stacklok/toolhive
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: APIGW request ID headers are inconsistent between server and clientForse già presa @zouxingyuks l’ha presa oggi. Apertaproduct/backlog
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
TencentBlueKing/bk-nodemgr#3782 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
praetorianer777/Dynamo#53 ·
I maintainer di solito rispondono entro 1 giorno
-
internal test setup
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
SAP/terraform-provider-scc#430 ·