HelmRepository: use conditional HTTP requests (ETag / If-Modified-Since) when fetching index.yaml
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go, kubernetes
- 領域
- backend, performance
調査の方向性
internal/helm/repository/chart_repository.go の CacheIndex と DownloadIndex から始め、次に internal/controller/helmrepository_controller.go の 464-468 行付近にある no-op の判断を追ってください。レスポンスバリデーターをオブジェクトごとに保持する方法と、body を読み取らずに 304 が既存の変更なしのパスに到達する仕組みを確認してください。バリデーターが存在する場合は条件付きリクエストが使用され、バリデーターのないリポジトリでは現在の動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
For HTTP(S) HelmRepository objects, source-controller downloads the full index.yaml on every reconcile interval, unconditionally: CacheIndex → DownloadIndex issues a plain GET, and only after the download completes is the digest compared against the current artifact to decide the reconcile is a no-op (helmrepository_controller.go#L464-L468). There is no If-None-Match / If-Modified-Since anywhere in the fetch path (the only ETag references in the codebase are the S3/GCS test mocks).
Real-world indexes are large (grafana ~2 MB, prometheus-community ~4 MB, bitnami historically >10 MB), and the cost is linear in the number of objects: N HelmRepository objects pointing at the same or different repos re-download N full indexes per interval, forever, even when nothing changed. In multi-tenant setups where each tenant namespace declares its own HelmRepository (cross-namespace refs disabled), N grows with the tenant count.
Measurements
Bench: k3s + source-controller v1.9.3, defaults; one HTTP helm repo with a 6.0 MB index; N HelmRepository objects with interval: 1m; server-side byte/request counters; idle steady state (index unchanged), 5-minute windows.
| N objects | index GETs / 5 min | bytes / 5 min | projected / day |
|---|---|---|---|
| 1 | 5 | 31.0 MB | 1,440 GETs / 8.9 GB |
| 10 | 50 | 309.7 MB | 14,400 GETs / 89 GB |
| 50 | 249 | 1.54 GB | ~72,000 GETs / ~444 GB |
Every one of those bytes is thrown away: the digest comparison concludes "unchanged" after each download.
Proposal
Remember the ETag / Last-Modified response headers per object (an in-memory map keyed by object UID is sufficient — a controller restart just pays one full fetch), and send If-None-Match / If-Modified-Since on the next reconcile. On 304 Not Modified, short-circuit to the existing no-op path without touching the body. When the server sends no validators, behaviour is unchanged.
GitHub Pages, S3/CloudFront, Cloudflare, nginx/static hosting and Harbor all emit validators for static index files, so the common cases are covered.
This mirrors what the controller already does for the other source kinds — GitRepository checks advertised refs before cloning, OCIRepository resolves the manifest digest via HEAD before pulling — HelmRepository/HTTP is the only kind that must download the full payload to discover nothing changed.
Happy to send the PR.
- 主要言語
- Go
- スター
- 283
- フォーク
- 258
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluxcd/source-controller のほかの issue
-
Improve documentation on debugging the controller locally再び着手できるかも @Bryandero98 が 29 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea/docs good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fluxcd/source-controller#666 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/oci enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fluxcd/source-controller#2180 ·
メンテナーはふだん 1 日以内に返信
-
`OCIRepository`/cosign verification: support TSA-only trusted roots (no transparency log) for private Sigstore instances like GitHub Artifact Attestations対応中かも @stealthybox が 143 日前に担当しました。 オープンarea/oci area/security enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
fluxcd/source-controller#2167 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fluxcd/source-controller#2150 ·
メンテナーはふだん 1 日以内に返信
-
GitRepository `.spec.ref.commit` + `.spec.ref.branch` does not shallow clone, contrary to the docsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
fluxcd/source-controller#2146 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
fluxcd/source-controller の issue をすべて見る
似ている issue
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
難易度 2/5 半日 初心者へのやさしさ 85/100
hyperledger-labs/fabric-smart-client#2142 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
numberly/vault-db-injector#107 ·
メンテナーはふだん 1 日以内に返信
-
area/import kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[DOC] Wrong sg_egress_ports range in the Terraform Databricks Guide for AWS Hub & Spoke with Network Firewall対応中かも @akhil9tiet が今日担当しました。 オープンdocs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
databricks/terraform-provider-databricks#6080 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
spqr-coordinator usage shows 'run --config', but 'run' is not a subcommand (unknown command "run")オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pg-sharding/spqr#3092 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信