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

オープン
#1,316 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, kubernetes

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
63
フォーク
162
平均マージ
9時間 54分
マージ済み PR(30日)
29

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluxcd/pkg のほかの issue

fluxcd/pkg の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。