HelmRepository: use conditional HTTP requests (ETag / If-Modified-Since) when fetching index.yaml
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- go, kubernetes
- Ambito
- backend, performance
Direzione di ricerca
Inizia in internal/helm/repository/chart_repository.go, in corrispondenza di CacheIndex e DownloadIndex, quindi segui la decisione di no-op in internal/controller/helmrepository_controller.go intorno alle righe 464-468. Verifica come i validatori della risposta possano essere mantenuti per ogni oggetto e come un 304 raggiunga il percorso esistente per i contenuti invariati senza leggere il body. Il lavoro è completo quando vengono usate richieste condizionali se esistono validatori, mentre i repository senza validatori mantengono il comportamento attuale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 283
- Fork
- 252
- Merge medio
- 1h 6m
- PR unite (30g)
- 12
Guida per i contributori
Apri 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 fluxcd/source-controller
-
area/docs good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
fluxcd/source-controller#666 · 2 commenti ·
-
area/git bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
fluxcd/source-controller#2165 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fluxcd/source-controller#2150 ·
-
GitRepository `.spec.ref.commit` + `.spec.ref.branch` does not shallow clone, contrary to the docs Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
fluxcd/source-controller#2146 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
fluxcd/source-controller#2136 · 1 commento ·
Tutte le issue di fluxcd/source-controller
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·