kustomize.Build re-parses the built-in OpenAPI schema on every call

Aperta
#1,316 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

Start in the kustomize.Build path, where resetOpenAPIWithBuiltins() runs before each build and openapi.ResetOpenAPI() after it, under kustomizeBuildMutex. Read how kyaml's global schema is cleared and re-parsed, and the fix from #1237 that keeps custom openapi: schemas from leaking between builds. Done means the built-in schema is parsed once per process and restored per build, custom schemas still reset, and the output is unchanged. Confirm this with the maintainers before starting, since the design is open.

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

Descrizione

kustomize.Build calls resetOpenAPIWithBuiltins() before each build and openapi.ResetOpenAPI() after it.

Each reset clears kyaml's global schema, so the next openapi.Schema() re-parses the whole embedded Kubernetes OpenAPI bundle. This happens on every build, under kustomizeBuildMutex.

In a process that runs many builds, this parse dominates: about 14 MiB allocated and ~28 ms of locked time per build. Parsing the bundle once per process halved total wall time with identical output.

The reset is needed so a custom openapi: schema cannot leak into later builds (#1237). Could the parsed built-in schema be kept and restored instead of re-parsed, while still resetting custom schemas?

Happy to send a PR.

Lingua principale
Go
Stelle
63
Fork
162
Merge medio
9h 54m
PR unite (30g)
29

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 fluxcd/pkg

Tutte le issue di fluxcd/pkg

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.