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

Đang mở
#1,316 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
devops, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
63
Fork
162
Merge trung bình
9 giờ 54 phút
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluxcd/pkg

Tất cả issue của fluxcd/pkg

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.