Optimize patches returned by Defaulter
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia tracciando la generazione delle patches di Defaulter e CustomDefaulter da WithDefaulter, quindi esamina la gestione di req.SubResource e req.Object.Raw. Verifica i tre casi elencati, incluso uno status vuoto, e considera come l’opzione WithDefaulter distinguerebbe il comportamento della status-subresource; il lavoro è concluso quando le patches contengono solo le sezioni rilevanti dell’oggetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Today our Defaulter and CustomDefaulter implementations always compare the entire req.Object.Raw with the object mutated by the Default func.
The result is that we always return patches for metadata, spec and status if there are differences including cases where e.g. the status marhals to an empty object. For example in the latter case the webhook returns a patch to add an empty status object.
We have the following cases where the Defaulter webhook is called:
- CRs without status subresource
- for the entire object => we actually have to return patches for the entire object (correct as of today)
- CRDs with status subresource
- for spec & metadata => we should only return patches for spec & metadata (today we also return patches for status)
- I'm not aware of any way to detect this at runtime, we could maybe introduce an option on the
WithDefaulterfunc.
- I'm not aware of any way to detect this at runtime, we could maybe introduce an option on the
- for status => we should only return patches for status (today we also return patches for spec & metadata)
- We should be able to optimize this by dropping all non-status patches if
req.SubResource == "status"
- We should be able to optimize this by dropping all non-status patches if
- for spec & metadata => we should only return patches for spec & metadata (today we also return patches for status)
The reason why I'm bringing this up is because I've noticed that in a lot of cases our Cluster API webhooks are returning patches for status fields that are never used (and eventually discarded by the apiserver). Would be better if we don't return those patches in the first place. If we only compare the relevant parts of the object we should be also able to slightly improve the performance of the webhooks.
- Lingua principale
- Go
- Stelle
- 3k
- Fork
- 1.3k
- Merge medio
- 1g 7h
- PR unite (30g)
- 48
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 kubernetes-sigs/controller-runtime
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kubernetes-sigs/controller-runtime#3704 ·
I maintainer di solito rispondono entro 1 giorno
-
lifecycle/rotten
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kubernetes-sigs/controller-runtime#3537 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Read-your-writes consistency is not applied to unstructured objects written with Update or PatchForse già presa @7616e5a9c573ffb221843a498885ab0f l’ha presa 1 giorno fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
kubernetes-sigs/controller-runtime#3702 ·
I maintainer di solito rispondono entro 1 giorno
-
Client and DynamicRESTMapper keep a kind's old scope after its CRD is recreated with a different `scope`Forse già presa @AdamMagued l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
kubernetes-sigs/controller-runtime#3671 ·
I maintainer di solito rispondono entro 1 giorno
-
ReadYourWrite doesn't correctly deal with mutating requests removing the last finalizerForse già presa @AdamMagued l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
kubernetes-sigs/controller-runtime#3670 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di kubernetes-sigs/controller-runtime
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
OneBusAway/watchdog#470 ·
I maintainer di solito rispondono entro 1 giorno
-
area: session
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
charmbracelet/crush#4484 ·
I maintainer di solito rispondono entro 1 giorno
-
[Resource]: HearthApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
hesreallyhim/awesome-claude-code#3713 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
expr-lang/expr#1037 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
provider-key submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
opentofu/registry#6740 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno